cleaning (prospector complaint)
This commit is contained in:
parent
44015082a3
commit
22da3af92e
|
@ -3,27 +3,27 @@ import datetime
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import pytest
|
import pytest
|
||||||
from _pytest.monkeypatch import MonkeyPatch
|
|
||||||
|
|
||||||
import damask
|
import damask
|
||||||
|
|
||||||
|
|
||||||
patched_version = '99.99.99-9999-pytest'
|
patched_version = '99.99.99-9999-pytest'
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def patch_damask_version(monkeysession):
|
def patch_damask_version(monkeypatch):
|
||||||
"""Set damask.version for reproducible tests results."""
|
"""Set damask.version for reproducible tests results."""
|
||||||
monkeysession.setattr(damask, 'version', patched_version)
|
monkeypatch.setattr(damask, 'version', patched_version)
|
||||||
|
|
||||||
|
|
||||||
patched_date = datetime.datetime(2019, 11, 2, 11, 58, 0)
|
patched_date = datetime.datetime(2019, 11, 2, 11, 58, 0)
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def patch_datetime_now(monkeysession):
|
def patch_datetime_now(monkeypatch):
|
||||||
"""Set datetime.datetime.now for reproducible tests results."""
|
"""Set datetime.datetime.now for reproducible tests results."""
|
||||||
class mydatetime:
|
class mydatetime:
|
||||||
@classmethod
|
@classmethod
|
||||||
def now(cls):
|
def now(cls):
|
||||||
return patched_date
|
return patched_date
|
||||||
|
|
||||||
monkeysession.setattr(datetime, 'datetime', mydatetime)
|
monkeypatch.setattr(datetime, 'datetime', mydatetime)
|
||||||
|
|
||||||
|
|
||||||
def pytest_addoption(parser):
|
def pytest_addoption(parser):
|
||||||
|
|
|
@ -7,7 +7,6 @@ import pytest
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
from PIL import ImageChops
|
from PIL import ImageChops
|
||||||
|
|
||||||
import damask
|
|
||||||
from damask import Colormap
|
from damask import Colormap
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
|
@ -22,7 +21,6 @@ class TestColormap:
|
||||||
print('patched damask.version')
|
print('patched damask.version')
|
||||||
|
|
||||||
def test_conversion(self):
|
def test_conversion(self):
|
||||||
|
|
||||||
specials = np.array([[0.,0.,0.],
|
specials = np.array([[0.,0.,0.],
|
||||||
[1.,0.,0.],
|
[1.,0.,0.],
|
||||||
[0.,1.,0.],
|
[0.,1.,0.],
|
||||||
|
|
Loading…
Reference in New Issue