We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents a8f3a3a + c813dcf commit a711387Copy full SHA for a711387
1 file changed
test/test-config.py
@@ -343,6 +343,13 @@ def setUpClass(cls):
343
344
@classmethod
345
def tearDownClass(cls):
346
+ # IMPORTANT: reset the SysConf singleton to an empty config BEFORE
347
+ # deleting the temp file. SysConf caches _config in memory; simply
348
+ # deleting the file leaves the 224-char NQN in the cache. When pytest
349
+ # runs all test files in one process, trid.TID.__init__ unconditionally
350
+ # evaluates sysconf.hostnqn (as the default arg to dict.get), so every
351
+ # TID construction in later test files would hit sys.exit.
352
+ conf.SysConf().set_conf_file('/dev/null')
353
if os.path.exists(cls.FNAME):
354
os.remove(cls.FNAME)
355
0 commit comments