Skip to content

Commit c52d811

Browse files
committed
Try and fix tests.
1 parent 31131b3 commit c52d811

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

tests/tests_integration/test_logging.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,18 @@
2323

2424

2525
class TestLogging:
26-
@pytest.fixture(scope="function")
26+
@pytest.fixture(scope="function", autouse=True)
2727
def teardown_logger(self):
28-
"""Ensure the logger is deleted at the end of each test."""
28+
"""Ensure the logger is deleted at the start and after the test."""
29+
ds_logger.close_log_filehandler()
30+
if "datashuttle" in logging.root.manager.loggerDict:
31+
logging.root.manager.loggerDict.pop("datashuttle", None)
32+
2933
yield
34+
35+
ds_logger.close_log_filehandler()
3036
if "datashuttle" in logging.root.manager.loggerDict:
31-
logging.root.manager.loggerDict.pop("datashuttle")
37+
logging.root.manager.loggerDict.pop("datashuttle", None)
3238

3339
# -------------------------------------------------------------------------
3440
# Basic Functionality Tests

0 commit comments

Comments
 (0)