[Darshan-commits] [Git][darshan/darshan][master] 2 commits: TST: add DarshanReport open test
Shane Snyder
xgitlab at cels.anl.gov
Tue May 11 15:32:46 CDT 2021
Shane Snyder pushed to branch master at darshan / darshan
Commits:
7b764116 by Tyler Reddy at 2021-04-20T11:56:20-06:00
TST: add DarshanReport open test
* add test cases to cover previously untested scenario
of `DarshanReport()` properly handling invalid file paths
- - - - -
18d1054a by Shane Snyder at 2021-05-11T15:30:57-05:00
Merge branch 'treddy/darshan-treddy_test_invalid_darshanreport_file_open' into HEAD
- - - - -
1 changed file:
- darshan-util/pydarshan/tests/test_report.py
Changes:
=====================================
darshan-util/pydarshan/tests/test_report.py
=====================================
@@ -93,3 +93,19 @@ def test_info_contents(capsys):
for expected_string in expected_strings:
assert expected_string in captured.out
+
+ at pytest.mark.parametrize("invalid_filepath", [
+ # messy path that does not exist
+ '#!$%',
+ # path that exists but has no
+ # actual log file
+ '.',
+ ]
+ )
+def test_report_invalid_file(invalid_filepath):
+ # verify appropriate error handling for
+ # provision of an invalid file path to
+ # DarshanReport
+
+ with pytest.raises(RuntimeError, match='Failed to open file'):
+ darshan.DarshanReport(invalid_filepath)
View it on GitLab: https://xgitlab.cels.anl.gov/darshan/darshan/-/compare/65f4ed71507283d40e8584827aaafb70cdc617d2...18d1054a255b2b008ba9e8c3e5d105e83b127f72
--
View it on GitLab: https://xgitlab.cels.anl.gov/darshan/darshan/-/compare/65f4ed71507283d40e8584827aaafb70cdc617d2...18d1054a255b2b008ba9e8c3e5d105e83b127f72
You're receiving this email because of your account on xgitlab.cels.anl.gov.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/darshan-commits/attachments/20210511/96bb20ed/attachment.html>
More information about the Darshan-commits
mailing list