[tox] envlist = py{39,py39,310,py310,311,312,313}-{brief,full,cover,nocover,niche,custom} toxworkdir={env:TOX_WORK_DIR:.tox} [testenv] deps = -r../requirements/test.txt allowlist_externals = bash passenv= HOME LC_ALL COVERAGE_FILE TOXENV # Allow CI builds (or user builds) to force coloured terminal output. PY_COLORS setenv= PYTHONWARNDEFAULTENCODING=1 brief: HYPOTHESIS_PROFILE=speedy commands = full: bash scripts/basic-test.sh brief: python -bb -X dev -m pytest -n auto tests/cover/test_testdecorators.py {posargs} cover: python -bb -X dev -m pytest -n auto tests/cover/ tests/pytest/ tests/conjecture/ {posargs} conjecture: python -bb -X dev -m pytest -n auto tests/conjecture/ {posargs} nocover: python -bb -X dev -m pytest -n auto tests/nocover/ {posargs} niche: bash scripts/other-tests.sh custom: python -bb -X dev -m pytest {posargs} [testenv:py310-pyjion] deps = -r../requirements/test.txt # We'd like to pin this, but pip-compile has to run under Python 3.10 (+) # to do so and that's painful because other tools aren't compatible yet. # If it's mid-2022, try again, starting by updating ci_version to 3.10 pyjion commands = # TODO: restore `-n auto` https://github.com/tonybaloney/Pyjion/issues/456 # TODO: re-enable in Actions main.yml once this actually works pyjion -m pytest tests/cover tests/pytest tests/nocover [testenv:quality] deps= -r../requirements/test.txt commands= python -bb -X dev -m pytest tests/quality/ -n auto # This test job runs on the oldest version of CPython we support, against the minimum # version specified in our runtime dependencies. For now, that's the oldest version # with a wheel for non-EOL Python. In future we might deprecate faster per NEP-29. [testenv:py39-oldestnumpy] deps= -r../requirements/test.txt allowlist_externals = bash commands= bash -c "pip install --only-binary=:all: numpy==$(grep 'numpy>=' setup.py | grep -oE '[0-9.]+')" python -bb -X dev -m pytest tests/numpy/ -n auto # This test job runs against the nightly version of `numpy` [testenv:numpy-nightly] deps= -r../requirements/test.txt pandas black click allowlist_externals = bash commands= bash -c "pip install --upgrade --pre --only-binary :all: -i https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy" python -bb -X dev -m pytest tests/numpy/ tests/array_api/ tests/pandas/ tests/ghostwriter/ tests/conjecture/ tests/cover -n auto # Note: when adding or removing tested Pandas versions, make sure to update the # docs in numpy.rst too. To see current download rates of each minor version: # https://pepy.tech/project/pandas?versions=1.1.*&versions=1.2.*&versions=1.3.*&versions=1.4.*&versions=1.5.*&versions=2.0.*&versions=2.1.*&versions=2.2.* [testenv:py39-pandas11] deps = -r../requirements/test.txt numpy~=1.26.4 pandas~=1.1.5 commands = python -bb -X dev -m pytest tests/pandas -n auto [testenv:py39-pandas12] deps = -r../requirements/test.txt numpy~=1.26.4 pandas~=1.2.5 commands = python -bb -X dev -m pytest tests/pandas -n auto [testenv:pandas13] deps = -r../requirements/test.txt numpy~=1.26.4 pandas~=1.3.5 commands = python -bb -X dev -m pytest tests/pandas -n auto [testenv:pandas14] deps = -r../requirements/test.txt numpy~=1.26.4 pandas~=1.4.4 commands = python -bb -X dev -m pytest tests/pandas -n auto [testenv:pandas15] deps = -r../requirements/test.txt numpy~=1.26.4 pandas~=1.5.3 commands = python -bb -X dev -m pytest tests/pandas -n auto [testenv:pandas20] deps = -r../requirements/test.txt numpy~=1.26.4 pandas~=2.0.3 commands = python -bb -X dev -m pytest tests/pandas -n auto [testenv:pandas21] deps = -r../requirements/test.txt numpy~=1.26.4 pandas~=2.1.4 setenv= PYTHONWARNDEFAULTENCODING=1 commands = python -bb -X dev -m pytest tests/pandas -n auto [testenv:pandas22] deps = -r../requirements/test.txt pandas~=2.2.2 # https://pandas.pydata.org/docs/whatsnew/v2.2.2.html#pandas-2-2-2-is-now-compatible-with-numpy-2-0 setenv= PYTHONWARNDEFAULTENCODING=1 commands = python -bb -X dev -m pytest tests/pandas -n auto # Adding a new pandas? See comment above! [testenv:crosshair-{cover,nocover,niche,custom}] deps = -r../requirements/test.txt -e .[crosshair] allowlist_externals = bash setenv= HYPOTHESIS_PROFILE=crosshair commands = # invoke with `./build.sh check-crosshair-cover -- -x -Wignore` cover: python -bb -X dev -m pytest -n auto tests/cover/ tests/pytest/ {posargs} nocover: python -bb -X dev -m pytest -n auto tests/nocover/ {posargs} niche: bash scripts/other-tests.sh custom: python -bb -X dev -m pytest {posargs} [testenv:django42] setenv= PYTHONWARNDEFAULTENCODING=1 commands = pip install django==4.2.16 python -bb -X dev -m tests.django.manage test tests.django {posargs} [testenv:django50] setenv= PYTHONWARNDEFAULTENCODING=1 commands = pip install django==5.0.9 python -bb -X dev -m tests.django.manage test tests.django {posargs} [testenv:django51] setenv= PYTHONWARNDEFAULTENCODING=1 commands = pip install django==5.1.3 python -bb -X dev -m tests.django.manage test tests.django {posargs} [testenv:py{39}-nose] deps = nose commands= nosetests tests/cover/test_testdecorators.py [testenv:py{39}-pytest46] deps = -r../requirements/test.txt commands= pip install pytest==4.6.11 pytest-xdist==1.34 python -bb -X dev -W'ignore:the imp module:DeprecationWarning' -m pytest tests/pytest tests/cover/test_testdecorators.py [testenv:py{39}-pytest54] deps = -r../requirements/test.txt commands= pip install pytest==5.4.3 pytest-xdist python -bb -X dev -m pytest tests/pytest tests/cover/test_testdecorators.py [testenv:pytest62] deps = -r../requirements/test.txt setenv= PYTHONWARNDEFAULTENCODING= commands= pip install pytest==6.2.5 pytest-xdist python -bb -X dev -m pytest tests/pytest tests/cover/test_testdecorators.py [testenv:pytest7] deps = -r../requirements/test.txt commands= pip install pytest==7.* pytest-xdist python -bb -X dev -m pytest tests/pytest tests/cover/test_testdecorators.py [testenv:coverage] deps = -r../requirements/coverage.txt allowlist_externals = rm setenv= PYTHONWARNDEFAULTENCODING=1 HYPOTHESIS_INTERNAL_COVERAGE=true COVERAGE_PROCESS_START=.coveragerc commands_pre = rm -f branch-check* pip install .[zoneinfo] pip install coverage_enable_subprocess commands_post = pip uninstall -y coverage_enable_subprocess # Produce a coverage report even if the test suite fails. # (The tox task will still count as failed.) ignore_errors = true # We've had problems correctly measuring coverage using pytest-cov when running # in parallel, so instead we start coverage implicitly on all (sub-)processes by # way of the coverage_enable_subprocesses installation. This requires all options # to be set in .coveragerc (including source), but that's ok as it is overridden # by --cov=... in conjecture-coverage. commands = python -bb -X dev -m pytest -n auto --ff {posargs} \ tests/cover tests/conjecture tests/datetime tests/numpy tests/pandas tests/lark \ tests/redis tests/dpcontracts tests/codemods tests/typing_extensions tests/patching tests/test_annotated_types.py python -m coverage combine python -m coverage report python scripts/validate_branch_check.py [testenv:conjecture-coverage] deps = -r../requirements/coverage.txt setenv= PYTHONWARNDEFAULTENCODING=1 HYPOTHESIS_INTERNAL_COVERAGE=true commands = python -bb -X dev \ -m pytest -n auto tests/conjecture/ \ --cov=hypothesis.internal.conjecture --cov-config=.coveragerc [testenv:examples3] deps= -r../requirements/test.txt commands= python -m pip install --editable examples/example_hypothesis_entrypoint python -bb -X dev -m pytest examples