diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 639537ba..4373df59 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,6 +42,23 @@ jobs: - name: Run tests run: python -m tox -e flake8_5,flake8_6 + slow_tests: + runs-on: ubuntu-latest + strategy: + fail-fast: false + steps: + - uses: actions/checkout@v3 + - name: Set up Python 3.11 + uses: actions/setup-python@v3 + with: + python-version: 3.11 + - name: Install dependencies + run: | + python -m pip install --upgrade pip setuptools tox + python -m tox --notest --recreate -e flake8_6 + - name: Run tests + run: python -m tox -e flake8_6 -- --onlyfuzz --no-cov -n auto + release: runs-on: ubuntu-latest needs: [check, test] diff --git a/tests/conftest.py b/tests/conftest.py index 9e5a617e..c838e9a5 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -9,6 +9,9 @@ def pytest_addoption(parser: pytest.Parser): parser.addoption( "--runfuzz", action="store_true", default=False, help="run fuzz tests" ) + parser.addoption( + "--onlyfuzz", action="store_true", default=False, help="only run fuzz tests" + ) parser.addoption( "--generate-autofix", action="store_true", @@ -32,6 +35,13 @@ def pytest_collection_modifyitems(config: pytest.Config, items: list[pytest.Item if config.getoption("--runfuzz"): # --runfuzz given in cli: do not skip fuzz tests return + + if config.getoption("--onlyfuzz"): + for item in items.copy(): + if "fuzz" not in item.keywords: + items.remove(item) + return + skip_fuzz = pytest.mark.skip(reason="need --runfuzz option to run") for item in items: if "fuzz" in item.keywords: diff --git a/tox.ini b/tox.ini index e0846705..f2737d25 100644 --- a/tox.ini +++ b/tox.ini @@ -12,7 +12,7 @@ deps = flake8_5: flake8>=5.0,<6.0 pytest pytest-cov - #pytest-xdist + pytest-xdist hypothesis hypothesmith trio