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:
parent
b3f5ee022a
commit
1cfa6d44d9
|
@ -2,6 +2,11 @@ import os
|
||||||
|
|
||||||
import pytest
|
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):
|
def pytest_addoption(parser):
|
||||||
parser.addoption("--update",
|
parser.addoption("--update",
|
||||||
action="store_true",
|
action="store_true",
|
||||||
|
|
|
@ -127,7 +127,7 @@ class TestColormap:
|
||||||
('Gmsh','.msh')
|
('Gmsh','.msh')
|
||||||
])
|
])
|
||||||
def test_compare_reference(self,format,ext,tmpdir,reference_dir,update,monkeypatch):
|
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'
|
name = 'binary'
|
||||||
c = Colormap.from_predefined(name)
|
c = Colormap.from_predefined(name)
|
||||||
if update:
|
if update:
|
||||||
|
|
Loading…
Reference in New Issue