Skip to content

Commit 8a99848

Browse files
committed
testing: Only check for ValueError when strict
stratis only checks pool features strictly when STRATIS_STRICT_POOL_FEATURES is set, so that behavior should be tested only under these conditions. Signed-off-by: mulhern <amulhern@redhat.com>
1 parent d7bea12 commit 8a99848

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

tests/whitebox/unittest/test_constants.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"""
1717

1818
# isort: STDLIB
19+
import os
1920
import unittest
2021

2122
# isort: LOCAL
@@ -97,8 +98,9 @@ def test_str_method(self):
9798
for feature in PoolFeature:
9899
if feature is PoolFeature.UNRECOGNIZED:
99100
self.assertIsInstance(str(feature), str)
100-
with self.assertRaises(ValueError):
101-
PoolFeature("unknown")
101+
if bool(int(os.environ.get("STRATIS_STRICT_POOL_FEATURES", False))):
102+
with self.assertRaises(ValueError):
103+
PoolFeature("unknown")
102104
else:
103105
self.assertEqual(str(feature), feature.value)
104106
self.assertEqual(PoolFeature(feature.value), feature)

0 commit comments

Comments
 (0)