cleaning (prospector complaint)

This commit is contained in:
Martin Diehl 2020-08-24 00:42:58 +02:00
parent 44015082a3
commit 22da3af92e
2 changed files with 5 additions and 7 deletions

View File

@ -3,27 +3,27 @@ import datetime
import numpy as np
import pytest
from _pytest.monkeypatch import MonkeyPatch
import damask
patched_version = '99.99.99-9999-pytest'
@pytest.fixture
def patch_damask_version(monkeysession):
def patch_damask_version(monkeypatch):
"""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)
@pytest.fixture
def patch_datetime_now(monkeysession):
def patch_datetime_now(monkeypatch):
"""Set datetime.datetime.now for reproducible tests results."""
class mydatetime:
@classmethod
def now(cls):
return patched_date
monkeysession.setattr(datetime, 'datetime', mydatetime)
monkeypatch.setattr(datetime, 'datetime', mydatetime)
def pytest_addoption(parser):

View File

@ -7,7 +7,6 @@ import pytest
from PIL import Image
from PIL import ImageChops
import damask
from damask import Colormap
@pytest.fixture
@ -22,7 +21,6 @@ class TestColormap:
print('patched damask.version')
def test_conversion(self):
specials = np.array([[0.,0.,0.],
[1.,0.,0.],
[0.,1.,0.],