diff options
| author | Yuval Adam <_@yuv.al> | 2020-09-27 23:33:36 +0300 |
|---|---|---|
| committer | Yuval Adam <_@yuv.al> | 2020-09-27 23:33:36 +0300 |
| commit | 891cbb41f9be3074549ff93cda3db22210bb1321 (patch) | |
| tree | 87405d07a2682a59cc50894078d3f77d4f43baa4 | |
| parent | c7c47b112bcc96d5d1076fd92993b384937b6b09 (diff) | |
Add comparison tests
| -rw-r--r-- | Pipfile | 3 | ||||
| -rw-r--r-- | iss/tests/conftest.py | 20 | ||||
| -rw-r--r-- | iss/tests/test_compare.py | 6 |
3 files changed, 28 insertions, 1 deletions
@@ -21,7 +21,8 @@ geoip2 = "*" [scripts] format = "black iss" lint = "pylint -j 0 -d R,C iss" -test = "pytest" +test = "pytest iss/tests" +compare = "pytest iss/tests --compare" server = "uvicorn iss.server:app" [requires] 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 |
