Skip to content

Commit

Permalink
trying to fix a test
Browse files Browse the repository at this point in the history
  • Loading branch information
ashenvi10 committed Aug 28, 2024
1 parent 94dd2d8 commit 10254f2
Showing 1 changed file with 36 additions and 22 deletions.
58 changes: 36 additions & 22 deletions src/tests/test_staged.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,37 +16,51 @@
class TestLogging:
"""Tests logging in stagedtree"""

def setup(self):
"""Test setup"""
# pylint: disable=attribute-defined-outside-init
# stratified dataset
@pytest.fixture
def med_st(self):
med_df_path = (
Path(__file__)
.resolve()
.parent.parent.joinpath("../data/medical_dm_modified.xlsx")
)
self.med_s_z_paths = None
self.med_df = pd.read_excel(med_df_path)
self.med_st = StagedTree(
dataframe=self.med_df, sampling_zero_paths=self.med_s_z_paths
med_s_z_paths = None
med_df = pd.read_excel(med_df_path)
med_st = StagedTree(
dataframe=med_df, sampling_zero_paths=med_s_z_paths
)

# non-stratified dataset
fall_df_path = (
Path(__file__).resolve().parent.parent.joinpath("../data/Falls_Data.xlsx")
)
self.fall_s_z_paths = None
self.fall_df = pd.read_excel(fall_df_path)
self.fall_st = StagedTree(
dataframe=self.fall_df,
sampling_zero_paths=self.fall_s_z_paths,
)

def test_run_ahc_before_figure(self) -> None:
return med_st

# def setup(self):
# """Test setup"""
# # pylint: disable=attribute-defined-outside-init
# # stratified dataset
# med_df_path = (
# Path(__file__)
# .resolve()
# .parent.parent.joinpath("../data/medical_dm_modified.xlsx")
# )
# self.med_s_z_paths = None
# self.med_df = pd.read_excel(med_df_path)
# self.med_st = StagedTree(
# dataframe=self.med_df, sampling_zero_paths=self.med_s_z_paths
# )

# # non-stratified dataset
# fall_df_path = (
# Path(__file__).resolve().parent.parent.joinpath("../data/Falls_Data.xlsx")
# )
# self.fall_s_z_paths = None
# self.fall_df = pd.read_excel(fall_df_path)
# self.fall_st = StagedTree(
# dataframe=self.fall_df,
# sampling_zero_paths=self.fall_s_z_paths,
# )

def test_run_ahc_before_figure(self, med_st) -> None:
"""Tests expected error message is in the log when running without
running AHC"""
try:
self.med_st.create_figure()
med_st.create_figure()

except (InvocationException):
pass
Expand Down

0 comments on commit 10254f2

Please sign in to comment.