Commit beadde68 authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Misc. vasp bugfixes.

parent ed0188a4
Pipeline #97703 passed with stages
in 22 minutes and 55 seconds
Subproject commit 526118c4da40ed8da4ea34f552b2f89c8dc187ef
Subproject commit b9b5f1b074dd71a1a09368e214a91820c54ce94b
......@@ -240,12 +240,17 @@ def create_reference(data, pretty):
@pytest.fixture(scope='function')
def assert_parser_result(caplog):
def _assert(entry_archive: EntryArchive, has_errors: bool = False):
def _assert(entry_archive: EntryArchive, has_errors: bool = False, has_warnings: bool = None):
errors_exist = False
warnings_exist = False
for record in caplog.get_records(when='call'):
if record.levelname in ['ERROR', 'CRITICAL']:
errors_exist = True
if record.levelname in ['WARNING']:
warnings_exist = True
assert has_errors == errors_exist
if has_warnings is not None:
assert has_warnings == has_warnings
return _assert
......@@ -319,7 +324,7 @@ def test_broken_xml_vasp(assert_parser_result):
parser_name, mainfile = 'parsers/vasp', 'tests/data/parsers/vasp/broken.xml'
previous_wd = os.getcwd() # Get Working directory before parsing.
parsed_example = run_parser(parser_name, mainfile)
assert_parser_result(parsed_example, has_errors=True)
assert_parser_result(parsed_example, has_warnings=True)
# Check that cwd has not changed.
assert_parser_dir_unchanged(previous_wd, current_wd=os.getcwd())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment