dummy version could be useful for other tests

note that monkey patching requires direct access to damask.version in
the respective modules.
'from xx import yy' creates a copy (at least for the version string).
This commit is contained in:
Martin Diehl 2020-06-28 11:50:28 +02:00
parent b3f5ee022a
commit 1cfa6d44d9
2 changed files with 6 additions and 1 deletions

View File

@ -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",

View File

@ -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: