2020-06-28 03:07:46 +05:30
|
|
|
from pathlib import Path
|
2019-11-23 17:29:41 +05:30
|
|
|
|
|
|
|
import pytest
|
|
|
|
|
2020-06-28 15:20:28 +05:30
|
|
|
# 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'
|
|
|
|
|
|
|
|
|
2019-11-23 17:29:41 +05:30
|
|
|
def pytest_addoption(parser):
|
|
|
|
parser.addoption("--update",
|
|
|
|
action="store_true",
|
|
|
|
default=False)
|
|
|
|
|
|
|
|
@pytest.fixture
|
|
|
|
def update(request):
|
2019-11-27 17:49:58 +05:30
|
|
|
"""Store current results as new reference results."""
|
2019-11-23 17:29:41 +05:30
|
|
|
return request.config.getoption("--update")
|
|
|
|
|
|
|
|
@pytest.fixture
|
|
|
|
def reference_dir_base():
|
2019-11-27 17:49:58 +05:30
|
|
|
"""Directory containing reference results."""
|
2020-06-28 03:07:46 +05:30
|
|
|
return Path(__file__).parent/'reference'
|