feat: 一気通貫テストだけを実行するためのマーカーとコマンドを追加
This commit is contained in:
parent
8b94112606
commit
3b74a8ea9f
@ -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 = "*"
|
||||
|
||||
@ -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)
|
||||
|
||||
7
ecs/crm-datafetch/tests/test_walkthrough.py
Normal file
7
ecs/crm-datafetch/tests/test_walkthrough.py
Normal file
@ -0,0 +1,7 @@
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.mark.walk_through
|
||||
def test_walk_through():
|
||||
assert 0
|
||||
pass
|
||||
Loading…
x
Reference in New Issue
Block a user