From 891cbb41f9be3074549ff93cda3db22210bb1321 Mon Sep 17 00:00:00 2001 From: Yuval Adam <_@yuv.al> Date: Sun, 27 Sep 2020 23:33:36 +0300 Subject: Add comparison tests --- iss/tests/conftest.py | 20 ++++++++++++++++++++ iss/tests/test_compare.py | 6 ++++++ 2 files changed, 26 insertions(+) create mode 100644 iss/tests/conftest.py create mode 100644 iss/tests/test_compare.py (limited to 'iss/tests') diff --git a/iss/tests/conftest.py b/iss/tests/conftest.py new file mode 100644 index 0000000..b4ca80c --- /dev/null +++ b/iss/tests/conftest.py @@ -0,0 +1,20 @@ +import pytest + + +def pytest_addoption(parser): + parser.addoption( + "--compare", action="store_true", default=False, help="Run compare tests" + ) + + +def pytest_configure(config): + config.addinivalue_line("markers", "compare: mark test as a comparison test") + + +def pytest_collection_modifyitems(config, items): + if config.getoption("--compare"): + return + skip_compare = pytest.mark.skip(reason="need --compare option to run") + for item in items: + if "compare" in item.keywords: + item.add_marker(skip_compare) diff --git a/iss/tests/test_compare.py b/iss/tests/test_compare.py new file mode 100644 index 0000000..d50a6cb --- /dev/null +++ b/iss/tests/test_compare.py @@ -0,0 +1,6 @@ +import pytest + + +@pytest.mark.compare +def test_compare_pred(): + assert 1 == 1 -- cgit v1.3.1