Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

1234567891011121314151617181920212223242526272829303132
  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.'))