diff --git a/python/tests/conftest.py b/python/tests/conftest.py index 411c07a8c..a7bc59f98 100644 --- a/python/tests/conftest.py +++ b/python/tests/conftest.py @@ -2,6 +2,11 @@ import os import pytest +# Use to monkeypatch damask.version (for comparsion to reference files that contain version information) +def pytest_configure(): + pytest.dummy_version = '99.99.99-9999-pytest' + + def pytest_addoption(parser): parser.addoption("--update", action="store_true", diff --git a/python/tests/test_Colormap.py b/python/tests/test_Colormap.py index b95d23a86..8d3d51018 100644 --- a/python/tests/test_Colormap.py +++ b/python/tests/test_Colormap.py @@ -127,7 +127,7 @@ class TestColormap: ('Gmsh','.msh') ]) def test_compare_reference(self,format,ext,tmpdir,reference_dir,update,monkeypatch): - monkeypatch.setattr(damask, 'version', '99.99.99-9999-pytest') + monkeypatch.setattr(damask, 'version', pytest.dummy_version) name = 'binary' c = Colormap.from_predefined(name) if update: