Skip to content

Commit 2efbbc7

Browse files
authored
Accept multiple error codes descriptions in test_error_message (#2008)
1 parent 6ded97d commit 2efbbc7

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/nifgen/system_tests/test_system_nifgen.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,15 @@ def test_error_message(self, session_creation_kwargs):
7070
with nifgen.Session('', '0', False, 'Simulate=1, DriverSetup=Model:invalid_model (2CH);BoardType:PXIe', **session_creation_kwargs):
7171
assert False
7272
except nifgen.Error as e:
73-
assert e.code == -1074134944
74-
assert e.description.find('Insufficient location information or resource not present in the system.') != -1
73+
# The returned error has changed over time, so accept multiple error codes, descriptions.
74+
# Users should generally not look for specific error codes and should instead correct their code if they hit an error.
75+
assert e.code in [-1074134944, -1074134964]
76+
assert any(
77+
[
78+
e.description.find('Insufficient location information or resource not present in the system.') != -1,
79+
e.description.find('The option string parameter contains an entry with an unknown option value.') != -1,
80+
]
81+
)
7582

7683
def test_get_error(self, session):
7784
try:

0 commit comments

Comments
 (0)