Skip to content

Commit c5fb297

Browse files
committed
account for different test conditions
Signed-off-by: Zen <[email protected]>
1 parent 07b6824 commit c5fb297

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/test_logging.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,11 @@ def test_class_logger_log_init(self):
5050
test_class = TestClass(logger=test_logger, _log_init=True)
5151
self.assertTrue(hasattr(test_class, "logger"))
5252
self.assertIn("INFO: Initializing class: TestClass", test_handler.records)
53-
self.assertIn("DEBUG: [TestClass] Package version not found for: tests", test_handler.records)
5453
self.assertIn("INFO: [TestClass] Class version: 1.2.3", test_handler.records)
54+
# The package name depends on where tests are run from
55+
package_name = __name__.split(".")[0]
56+
self.assertIn(f"DEBUG: [TestClass] Package version not found for: {package_name}", test_handler.records)
57+
5558

5659

5760
if __name__ == "__main__":

0 commit comments

Comments
 (0)