diff --git a/conftest.py b/conftest.py index 590189ee..75dedc31 100644 --- a/conftest.py +++ b/conftest.py @@ -21,6 +21,12 @@ def pytest_addoption(parser): dest="headless", help="Run with graphics", ) + parser.addoption( + "--include-motion-planning", + action="store_true", + default=False, + help="Include motion planning tests (disabled by default)", + ) # These parameter names match up with the parameter names for @@ -54,12 +60,13 @@ def pytest_generate_tests(metafunc): # temporarily excludes the motion planning tests until the motion planning algorithms are working def pytest_collection_modifyitems(config, items): - """Exclude tests from motion_planning folder.""" - remaining = [] + if config.getoption("--include-motion-planning"): + return + + skip_mp = pytest.mark.skip(reason="motion planning not ready") for item in items: - if "motion_planning" not in str(item.fspath): - remaining.append(item) - items[:] = remaining + if "motion_planning" in item.keywords: + item.add_marker(skip_mp) @pytest.fixture