From 40aca22a33c1f2af7a4ae53a29e6057f16cf645c Mon Sep 17 00:00:00 2001 From: "shimoda.m@nds-tyo.co.jp" Date: Fri, 19 Aug 2022 12:00:26 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=B8=80=E6=B0=97=E9=80=9A=E8=B2=AB?= =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E3=81=A0=E3=81=91=E3=82=92=E5=AE=9F?= =?UTF-8?q?=E8=A1=8C=E3=81=99=E3=82=8B=E3=81=9F=E3=82=81=E3=81=AE=E3=83=9E?= =?UTF-8?q?=E3=83=BC=E3=82=AB=E3=83=BC=E3=81=A8=E3=82=B3=E3=83=9E=E3=83=B3?= =?UTF-8?q?=E3=83=89=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ecs/crm-datafetch/Pipfile | 1 + ecs/crm-datafetch/tests/conftest.py | 20 ++++++++++++++++++++ ecs/crm-datafetch/tests/test_walkthrough.py | 7 +++++++ 3 files changed, 28 insertions(+) create mode 100644 ecs/crm-datafetch/tests/test_walkthrough.py diff --git a/ecs/crm-datafetch/Pipfile b/ecs/crm-datafetch/Pipfile index 82796598..6912e1a0 100644 --- a/ecs/crm-datafetch/Pipfile +++ b/ecs/crm-datafetch/Pipfile @@ -7,6 +7,7 @@ name = "pypi" test = "pytest tests/" "test:cov" = "pytest --cov=src --cov-branch --cov-report=term-missing tests/" "test:report" = "pytest --cov=src --cov-branch --cov-report=term-missing --html=.report/test_result.html tests/" +"test:walk-through" = "pytest tests/ --walk-through" [packages] boto3 = "*" diff --git a/ecs/crm-datafetch/tests/conftest.py b/ecs/crm-datafetch/tests/conftest.py index 55ade88c..b86b29d9 100644 --- a/ecs/crm-datafetch/tests/conftest.py +++ b/ecs/crm-datafetch/tests/conftest.py @@ -57,3 +57,23 @@ def pytest_runtest_makereport(item, call): report.cases = docstring.get("Cases", '') # 「テスト内容」を`report`に追加 report.arranges = docstring.get("Arranges", '') # 「準備作業」を`report`に追加 report.expects = docstring.get("Expects", '') # 「期待結果」を`report`に追加 + + +def pytest_addoption(parser): + parser.addoption( + "--walk-through", action="store_true", default=False, help="run walk through tests" + ) + + +def pytest_configure(config): + config.addinivalue_line("markers", "slow: mark test as slow to run") + + +def pytest_collection_modifyitems(config, items): + skip_slow = pytest.mark.skip(reason="need --walk-through option to run") + if config.getoption("--walk-through"): + [item.add_marker(skip_slow) for item in items if "walk_through" not in item.keywords] + return + for item in items: + if "walk_through" in item.keywords: + item.add_marker(skip_slow) diff --git a/ecs/crm-datafetch/tests/test_walkthrough.py b/ecs/crm-datafetch/tests/test_walkthrough.py new file mode 100644 index 00000000..2a3b09f2 --- /dev/null +++ b/ecs/crm-datafetch/tests/test_walkthrough.py @@ -0,0 +1,7 @@ +import pytest + + +@pytest.mark.walk_through +def test_walk_through(): + assert 0 + pass