diff --git a/news/fix-ci.rst b/news/fix-ci.rst new file mode 100644 index 0000000..c0d8852 --- /dev/null +++ b/news/fix-ci.rst @@ -0,0 +1,23 @@ +**Added:** + +* No news added: Fix path separator mismatch for different platforms in the tests. + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +* diff --git a/tests/test_runmacro.py b/tests/test_runmacro.py index a2545ba..cbd1be8 100644 --- a/tests/test_runmacro.py +++ b/tests/test_runmacro.py @@ -1,3 +1,4 @@ +import re from pathlib import Path import numpy @@ -186,7 +187,7 @@ def test_command_processor( ( 'load structure foo from "/nonexistent/path.cif"', FileNotFoundError, - "structure /nonexistent/path.cif not found. " + f"structure {Path('/nonexistent/path.cif')} not found. " "Please ensure the path is correct and the file exists.", ), ( @@ -207,5 +208,5 @@ def test_command_processor( ) def test_load_command_processor_bad(command_string, expected_exception, match): parser = MacroParser() - with pytest.raises(expected_exception, match=match): + with pytest.raises(expected_exception, match=re.escape(match)): parser.parse(command_string)