diff --git a/.github/workflows/Tests.yaml b/.github/workflows/Tests.yaml index 4b5d00c6..7db6f910 100644 --- a/.github/workflows/Tests.yaml +++ b/.github/workflows/Tests.yaml @@ -35,7 +35,7 @@ jobs: pip install -e .[test,scripts] - name: Run the tests - run: inv coverage --args "--runslow -vvv" + run: inv coverage --args "--runslow --runinstalled -vvv" - name: Upload coverage report to codecov if: matrix.python == '3.12' diff --git a/CHANGELOG.md b/CHANGELOG.md index 0864fe08..2729ae86 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Simplify type annotations by replacing Union and Optional with pipe character ("|") for improved readability and clarity +### Fixed +- Add back the `--runinstalled` flag for test execution to allow smooth testing on other build chains (#139) + ## [3.3.2] - 2024-03-25 ### Added diff --git a/tests/conftest.py b/tests/conftest.py index a72c83bd..b4479506 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -10,16 +10,28 @@ def pytest_addoption(parser): parser.addoption( "--runslow", action="store_true", default=False, help="run slow tests" ) + parser.addoption( + "--runinstalled", + action="store_true", + default=False, + help="run tests checking for installed features", + ) def pytest_configure(config): config.addinivalue_line("markers", "slow: mark test as slow to run") + config.addinivalue_line( + "markers", "installed: mark test as testing installed features" + ) def pytest_collection_modifyitems(config, items): skip_slow = pytest.mark.skip(reason="need --runslow option to run") + skip_installed = pytest.mark.skip(reason="need --runinstalled option to run") for item in items: + if "installed" in item.keywords and not config.getoption("--runinstalled"): + item.add_marker(skip_installed) if "slow" in item.keywords and not config.getoption("--runslow"): item.add_marker(skip_slow) diff --git a/tests/ogvjs/test_ogvjs.py b/tests/ogvjs/test_ogvjs.py index 94d4ada0..f53e6350 100644 --- a/tests/ogvjs/test_ogvjs.py +++ b/tests/ogvjs/test_ogvjs.py @@ -44,6 +44,7 @@ def prepare_ogvjs_folder(tmp_path, videojs_url, ogvjs_url, videojs_ogvjs_url): tmp_path.joinpath(member).rename(tmp_path.joinpath("videojs-ogvjs.js")) +@pytest.mark.installed def test_ogvjs_installed_script_missing_param(): # run from installed script to check real conditions script = subprocess.run( @@ -63,6 +64,7 @@ def test_ogvjs_from_code_missing_params(): @pytest.mark.slow +@pytest.mark.installed def test_ogvjs_installed_script_ok(tmp_path, videojs_url, ogvjs_url, videojs_ogvjs_url): # run from installed script to check real conditions