You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
1.2KB

  1. from typing import Any
  2. from pathlib import Path
  3. import pytest
  4. from _pytest.config import Config as PyTestConfig
  5. # Ensure the fixtures are registered with PyTest:
  6. from dds_ci.testing.fixtures import * # pylint: disable=wildcard-import,unused-wildcard-import
  7. from dds_ci.testing.http import * # pylint: disable=wildcard-import,unused-wildcard-import
  8. def pytest_addoption(parser: Any) -> None:
  9. parser.addoption('--test-deps',
  10. action='store_true',
  11. default=False,
  12. help='Run the exhaustive and intensive dds-deps tests')
  13. parser.addoption('--dds-exe', help='Path to the dds executable under test', type=Path)
  14. def pytest_configure(config: Any) -> None:
  15. config.addinivalue_line('markers', 'deps_test: Deps tests are slow. Enable with --test-deps')
  16. def pytest_collection_modifyitems(config: PyTestConfig, items: Any) -> None:
  17. if config.getoption('--test-deps'):
  18. return
  19. for item in items:
  20. if 'deps_test' not in item.keywords:
  21. continue
  22. item.add_marker(
  23. pytest.mark.skip(
  24. reason='Exhaustive deps tests are slow and perform many Git clones. Use --test-deps to run them.'))