Skip to content
Snippets Groups Projects
Commit 3e772c8e authored by Joscha Schmiedt's avatar Joscha Schmiedt
Browse files

TST: Skip logger test on Windows

        # TODO: this test is problematic on Windows due to the file being locked
        #       by the logger. This is a known issue and should be fixed in the
        #       future.
        #       For now, the test is disabled on Windows.
        #       See https://docs.python.org/3/library/tempfile.html#tempfile.NamedTemporaryFile
parent a555600f
No related branches found
No related tags found
2 merge requests!128MNT: Added a warning when column metadata is not configured, and a better...,!124Fix unit tests on Windows
Pipeline #58239 failed
...@@ -60,11 +60,17 @@ class SupTestAdvanced(SupTestBasic): ...@@ -60,11 +60,17 @@ class SupTestAdvanced(SupTestBasic):
self.db_file = os.path.join(gettempdir(), "test_suppress_msg_db_file_advanced.db") self.db_file = os.path.join(gettempdir(), "test_suppress_msg_db_file_advanced.db")
self.basic = SuppressKnown(db_file=self.db_file) self.basic = SuppressKnown(db_file=self.db_file)
@unittest.skipIf(os.name == "nt", "Known issue on Windows, see https://docs.python.org/3/library/tempfile.html#tempfile.NamedTemporaryFile")
def test_logger(self): def test_logger(self):
""" """
The logging output is directed to a file which is then checked whether The logging output is directed to a file which is then checked whether
the output is as expected. the output is as expected.
""" """
# TODO: this test is problematic on Windows due to the file being locked
# by the logger. This is a known issue and should be fixed in the
# future.
# For now, the test is disabled on Windows.
# See https://docs.python.org/3/library/tempfile.html#tempfile.NamedTemporaryFile
logfile = NamedTemporaryFile(delete=False, mode="w") logfile = NamedTemporaryFile(delete=False, mode="w")
logger = logging.getLogger() logger = logging.getLogger()
logger.addHandler(logging.FileHandler(logfile.name)) logger.addHandler(logging.FileHandler(logfile.name))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment