6 pytest_plugins = 'setuptools.tests.fixtures'
9 def pytest_addoption(parser):
11 "--package_name", action="append", default=[],
12 help="list of package_name to pass to test functions",
15 "--integration", action="store_true", default=False,
16 help="run integration tests (only)"
20 def pytest_configure(config):
21 config.addinivalue_line("markers", "integration: integration tests")
22 config.addinivalue_line("markers", "uses_network: tests may try to download files")
26 'tests/manual_test.py',
27 'setuptools/tests/mod_with_constant.py',
28 'setuptools/_distutils',
31 'pkg_resources/extern',
32 'pkg_resources/tests/data',
34 'pkg_resources/_vendor',
35 'setuptools/config/_validate_pyproject',
39 if sys.version_info < (3, 6):
40 collect_ignore.append('docs/conf.py') # uses f-strings
41 collect_ignore.append('pavement.py')
44 @pytest.fixture(autouse=True)
45 def _skip_integration(request):
46 running_integration_tests = request.config.getoption("--integration")
47 is_integration_test = request.node.get_closest_marker("integration")
48 if running_integration_tests and not is_integration_test:
49 pytest.skip("running integration tests only")
50 if not running_integration_tests and is_integration_test:
51 pytest.skip("skipping integration tests")