Skip to content

Commit 16f04b6

Browse files
Catch/test for correct error and otherwise re-raise NREL#365
1 parent cfd7cab commit 16f04b6

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

tests/geophires_x_tests/test_outputs.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,16 @@ def test_html_output_file(self):
2929
html_content = f.read()
3030
self.assertIn('***CASE REPORT***', html_content)
3131
# TODO expand test to assert more about output HTML
32-
except TypeError as te:
33-
if os.name == 'nt' and 'TOXPYTHON' in os.environ:
34-
# https://github.com/NREL/GEOPHIRES-X/issues/365
32+
except RuntimeError as e:
33+
# https://github.com/NREL/GEOPHIRES-X/issues/365
34+
has_expected_error_msg = 'cannot unpack non-iterable NoneType object' in str(e)
35+
if has_expected_error_msg and os.name == 'nt' and 'TOXPYTHON' in os.environ:
3536
_log.warning(
36-
f'Ignoring TypeError while testing HTML output file '
37-
f'since we appear to be running on Windows in GitHub Actions ({te!s})'
37+
f'Ignoring error while testing HTML output file '
38+
f'since we appear to be running on Windows in GitHub Actions ({e!s})'
3839
)
40+
else:
41+
raise e
3942

4043
def test_relative_output_file_path(self):
4144
input_file = GeophiresInputParameters({'HTML Output File': 'foo.html'}).as_file_path()

0 commit comments

Comments
 (0)