From c813dcf492c893d1f401982c583dc7ac37006475 Mon Sep 17 00:00:00 2001 From: Martin Belanger Date: Mon, 6 Apr 2026 17:34:59 -0400 Subject: [PATCH] tests: fix failing tests Signed-off-by: Martin Belanger --- test/test-config.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/test-config.py b/test/test-config.py index d7dc070..15361b0 100755 --- a/test/test-config.py +++ b/test/test-config.py @@ -343,6 +343,13 @@ def setUpClass(cls): @classmethod def tearDownClass(cls): + # IMPORTANT: reset the SysConf singleton to an empty config BEFORE + # deleting the temp file. SysConf caches _config in memory; simply + # deleting the file leaves the 224-char NQN in the cache. When pytest + # runs all test files in one process, trid.TID.__init__ unconditionally + # evaluates sysconf.hostnqn (as the default arg to dict.get), so every + # TID construction in later test files would hit sys.exit. + conf.SysConf().set_conf_file('/dev/null') if os.path.exists(cls.FNAME): os.remove(cls.FNAME)