summaryrefslogtreecommitdiffstats
path: root/test/test-nbft_conf.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-09-04 09:15:24 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-09-04 09:15:24 +0000
commitfd6bd8e3ee83881f2f40686b21502926ddf977af (patch)
tree6093d44e4716db2c1f768c23c78359e34bb8e819 /test/test-nbft_conf.py
parentAdding upstream version 2.3~rc3. (diff)
downloadnvme-stas-fd6bd8e3ee83881f2f40686b21502926ddf977af.tar.xz
nvme-stas-fd6bd8e3ee83881f2f40686b21502926ddf977af.zip
Adding upstream version 2.3~rc4.upstream/2.3_rc4
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/test-nbft_conf.py')
-rwxr-xr-xtest/test-nbft_conf.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/test/test-nbft_conf.py b/test/test-nbft_conf.py
index 072c3db..fa499e6 100755
--- a/test/test-nbft_conf.py
+++ b/test/test-nbft_conf.py
@@ -48,11 +48,12 @@ class Test(unittest.TestCase):
self.assertEqual(nbft_conf.iocs, EXPECTED_IOCS)
def test_dir_without_nbft_files(self):
- conf.NbftConf.destroy() # Make sure singleton does not exist
- with self.assertNoLogs(logger=logging.getLogger(), level='DEBUG'):
- nbft_conf = conf.NbftConf('/tmp')
- self.assertEqual(nbft_conf.dcs, [])
- self.assertEqual(nbft_conf.iocs, [])
+ if hasattr(self, 'assertNoLogs'): # assertNoLogs only in Python 3.10 or later
+ conf.NbftConf.destroy() # Make sure singleton does not exist
+ with self.assertNoLogs(logger=logging.getLogger(), level='DEBUG'):
+ nbft_conf = conf.NbftConf('/tmp')
+ self.assertEqual(nbft_conf.dcs, [])
+ self.assertEqual(nbft_conf.iocs, [])
if __name__ == "__main__":