-
-
Save ksindi/29c5456de16c6bb2e5ee9bb1202307b8 to your computer and use it in GitHub Desktop.
Categorise integration tests using PyTest.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pytest | |
def pytest_addoption(parser): | |
parser.addoption("--integration", action="store_true", help="run integration tests") | |
def pytest_runtest_setup(item): | |
if 'integration' in item.keywords: | |
if not item.config.getoption("--integration"): | |
pytest.skip("need --integration option to run") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pytest | |
def test_unit_test(): | |
assert True | |
@pytest.mark.integration | |
def test_integration_test(): | |
assert True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment