From 2efbbc7c7ebaed9e596595dc8335d9985d208c3d Mon Sep 17 00:00:00 2001 From: Jay Fitzgerald <34140133+ni-jfitzger@users.noreply.github.com> Date: Sat, 9 Sep 2023 18:39:56 -0500 Subject: [PATCH] Accept multiple error codes descriptions in test_error_message (#2008) --- src/nifgen/system_tests/test_system_nifgen.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/nifgen/system_tests/test_system_nifgen.py b/src/nifgen/system_tests/test_system_nifgen.py index de0663160..20e9c24f6 100644 --- a/src/nifgen/system_tests/test_system_nifgen.py +++ b/src/nifgen/system_tests/test_system_nifgen.py @@ -70,8 +70,15 @@ def test_error_message(self, session_creation_kwargs): with nifgen.Session('', '0', False, 'Simulate=1, DriverSetup=Model:invalid_model (2CH);BoardType:PXIe', **session_creation_kwargs): assert False except nifgen.Error as e: - assert e.code == -1074134944 - assert e.description.find('Insufficient location information or resource not present in the system.') != -1 + # The returned error has changed over time, so accept multiple error codes, descriptions. + # Users should generally not look for specific error codes and should instead correct their code if they hit an error. + assert e.code in [-1074134944, -1074134964] + assert any( + [ + e.description.find('Insufficient location information or resource not present in the system.') != -1, + e.description.find('The option string parameter contains an entry with an unknown option value.') != -1, + ] + ) def test_get_error(self, session): try: