From 22da3af92eb4f2fa81d2ae0c2073c44b8bb26138 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 24 Aug 2020 00:42:58 +0200 Subject: [PATCH] cleaning (prospector complaint) --- python/tests/conftest.py | 10 +++++----- python/tests/test_Colormap.py | 2 -- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/python/tests/conftest.py b/python/tests/conftest.py index a6f6e62ad..2912373a5 100644 --- a/python/tests/conftest.py +++ b/python/tests/conftest.py @@ -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): diff --git a/python/tests/test_Colormap.py b/python/tests/test_Colormap.py index 4fe0cc9fb..d3f5e45c8 100644 --- a/python/tests/test_Colormap.py +++ b/python/tests/test_Colormap.py @@ -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.],