Skip to content

Commit

Permalink
use test dir from environment if exists, for package testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Tamar Lavee authored and desilinguist committed Aug 15, 2023
1 parent 05b58ac commit ae1b3d3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions .ruff.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
fix = true
select = ["D", "E", "F", "I"]
ignore = ["D212"]
line-length = 100
Expand Down
10 changes: 9 additions & 1 deletion tests/test_wandb.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
import os
import unittest
from os.path import join
from unittest.mock import Mock, patch

import pandas as pd

from rsmtool.configuration_parser import Configuration
from rsmtool.test_utils import rsmtool_test_dir
from rsmtool.utils.wandb import (
init_wandb_run,
log_configuration_to_wandb,
log_dataframe_to_wandb,
log_report_to_wandb,
)

# allow test directory to be set via an environment variable
# which is needed for package testing
TEST_DIR = os.environ.get("TESTDIR", None)
if TEST_DIR:
rsmtool_test_dir = TEST_DIR
else:
from rsmtool.test_utils import rsmtool_test_dir


class TestWandb(unittest.TestCase):
def test_init_wandb_run_wandb_enabled(self):
Expand Down

0 comments on commit ae1b3d3

Please sign in to comment.