Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 48 additions & 67 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,32 +56,29 @@ jobs:
fail-fast: false
matrix:
name: [
"windows-py39-unittest-asynctest",
"windows-py39-unittest-twisted24",
"windows-py39-unittest-twisted25",
"windows-py39-pluggy",
"windows-py39-xdist",
"windows-py310",
"windows-py310-unittest-asynctest",
"windows-py310-unittest-twisted24",
"windows-py310-unittest-twisted25",
"windows-py310-pluggy",
"windows-py310-xdist",
"windows-py311",
"windows-py312",
"windows-py313",
"windows-py314",

"ubuntu-py39-unittest-asynctest",
"ubuntu-py39-unittest-twisted24",
"ubuntu-py39-unittest-twisted25",
"ubuntu-py39-lsof-numpy-pexpect",
"ubuntu-py39-pluggy",
"ubuntu-py39-freeze",
"ubuntu-py39-xdist",
"ubuntu-py310-unittest-asynctest",
"ubuntu-py310-unittest-twisted24",
"ubuntu-py310-unittest-twisted25",
"ubuntu-py310-lsof-numpy-pexpect",
"ubuntu-py310-pluggy",
"ubuntu-py310-freeze",
"ubuntu-py310-xdist",
"ubuntu-py311",
"ubuntu-py312",
"ubuntu-py313-pexpect",
"ubuntu-py314",
"ubuntu-pypy3-xdist",

"macos-py39",
"macos-py310",
"macos-py312",
"macos-py313",
Expand All @@ -93,35 +90,30 @@ jobs:

include:
# Use separate jobs for different unittest flavors (twisted, asynctest) to ensure proper coverage.
- name: "windows-py39-unittest-asynctest"
python: "3.9"
- name: "windows-py310-unittest-asynctest"
python: "3.10"
os: windows-latest
tox_env: "py39-asynctest"
tox_env: "py310-asynctest"
use_coverage: true

- name: "windows-py39-unittest-twisted24"
python: "3.9"
- name: "windows-py310-unittest-twisted24"
python: "3.10"
os: windows-latest
tox_env: "py39-twisted24"
tox_env: "py310-twisted24"
use_coverage: true

- name: "windows-py39-unittest-twisted25"
python: "3.9"
- name: "windows-py310-unittest-twisted25"
python: "3.10"
os: windows-latest
tox_env: "py39-twisted25"
tox_env: "py310-twisted25"
use_coverage: true

- name: "windows-py39-pluggy"
python: "3.9"
os: windows-latest
tox_env: "py39-pluggymain-pylib-xdist"

- name: "windows-py39-xdist"
python: "3.9"
- name: "windows-py310-pluggy"
python: "3.10"
os: windows-latest
tox_env: "py39-xdist"
tox_env: "py310-pluggymain-pylib-xdist"

- name: "windows-py310"
- name: "windows-py310-xdist"
python: "3.10"
os: windows-latest
tox_env: "py310-xdist"
Expand All @@ -147,44 +139,39 @@ jobs:
tox_env: "py314"

# Use separate jobs for different unittest flavors (twisted, asynctest) to ensure proper coverage.
- name: "ubuntu-py39-unittest-asynctest"
python: "3.9"
- name: "ubuntu-py310-unittest-asynctest"
python: "3.10"
os: ubuntu-latest
tox_env: "py39-asynctest"
tox_env: "py310-asynctest"
use_coverage: true

- name: "ubuntu-py39-unittest-twisted24"
python: "3.9"
- name: "ubuntu-py310-unittest-twisted24"
python: "3.10"
os: ubuntu-latest
tox_env: "py39-twisted24"
tox_env: "py310-twisted24"
use_coverage: true

- name: "ubuntu-py39-unittest-twisted25"
python: "3.9"
- name: "ubuntu-py310-unittest-twisted25"
python: "3.10"
os: ubuntu-latest
tox_env: "py39-twisted25"
tox_env: "py310-twisted25"
use_coverage: true

- name: "ubuntu-py39-lsof-numpy-pexpect"
python: "3.9"
- name: "ubuntu-py310-lsof-numpy-pexpect"
python: "3.10"
os: ubuntu-latest
tox_env: "py39-lsof-numpy-pexpect"
tox_env: "py310-lsof-numpy-pexpect"
use_coverage: true

- name: "ubuntu-py39-pluggy"
python: "3.9"
os: ubuntu-latest
tox_env: "py39-pluggymain-pylib-xdist"

- name: "ubuntu-py39-freeze"
python: "3.9"
- name: "ubuntu-py310-pluggy"
python: "3.10"
os: ubuntu-latest
tox_env: "py39-freeze"
tox_env: "py310-pluggymain-pylib-xdist"

- name: "ubuntu-py39-xdist"
python: "3.9"
- name: "ubuntu-py310-freeze"
python: "3.10"
os: ubuntu-latest
tox_env: "py39-xdist"
tox_env: "py310-freeze"

- name: "ubuntu-py310-xdist"
python: "3.10"
Expand Down Expand Up @@ -216,17 +203,11 @@ jobs:
use_coverage: true

- name: "ubuntu-pypy3-xdist"
python: "pypy-3.9"
python: "pypy-3.10"
os: ubuntu-latest
tox_env: "pypy3-xdist"


- name: "macos-py39"
python: "3.9"
os: macos-latest
tox_env: "py39-xdist"
use_coverage: true

- name: "macos-py310"
python: "3.10"
os: macos-latest
Expand Down Expand Up @@ -254,7 +235,7 @@ jobs:


- name: "doctesting"
python: "3.9"
python: "3.10"
os: ubuntu-latest
tox_env: "doctesting"
use_coverage: true
Expand All @@ -264,12 +245,12 @@ jobs:
contains(
fromJSON(
'[
"windows-py39-pluggy",
"windows-py310-pluggy",
"windows-py313",
"ubuntu-py39-pluggy",
"ubuntu-py39-freeze",
"ubuntu-py310-pluggy",
"ubuntu-py310-freeze",
"ubuntu-py313",
"macos-py39",
"macos-py310",
"macos-py313"
]'
),
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ repos:
hooks:
- id: pyupgrade
args:
- "--py39-plus"
- "--py310-plus"
# Manual because ruff does what pyupgrade does and the two are not out of sync
# often enough to make launching pyupgrade everytime worth it
stages: [manual]
Expand Down
18 changes: 9 additions & 9 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ Short version
#. Follow `PEP-8 <https://www.python.org/dev/peps/pep-0008/>`_ for naming.
#. Tests are run using ``tox``::

tox -e linting,py39
tox -e linting,py313

The test environments above are usually enough to cover most cases locally.

Expand Down Expand Up @@ -269,24 +269,24 @@ Here is a simple overview, with pytest-specific bits:

#. Run all the tests

You need to have Python 3.9 or later available in your system. Now
You need to have a supported Python version available in your system. Now
running tests is as simple as issuing this command::

$ tox -e linting,py39
$ tox -e linting,py

This command will run tests via the "tox" tool against Python 3.9
and also perform "lint" coding-style checks.
This command will run tests via the "tox" tool against your default Python
version and also perform "lint" coding-style checks.

#. You can now edit your local working copy and run the tests again as necessary. Please follow `PEP-8 <https://www.python.org/dev/peps/pep-0008/>`_ for naming.

You can pass different options to ``tox``. For example, to run tests on Python 3.9 and pass options to pytest
You can pass different options to ``tox``. For example, to run tests on Python 3.13 and pass options to pytest
(e.g. enter pdb on failure) to pytest you can do::

$ tox -e py39 -- --pdb
$ tox -e py313 -- --pdb

Or to only run tests in a particular test module on Python 3.9::
Or to only run tests in a particular test module on Python 3.12::

$ tox -e py39 -- testing/test_config.py
$ tox -e py312 -- testing/test_config.py


When committing, ``pre-commit`` will re-format the files if necessary.
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Features
- Can run `unittest <https://docs.pytest.org/en/stable/how-to/unittest.html>`_ (or trial)
test suites out of the box

- Python 3.9+ or PyPy3
- Python 3.10+ or PyPy3

- Rich plugin architecture, with over 1300+ `external plugins <https://docs.pytest.org/en/latest/reference/plugin_list.html>`_ and thriving community

Expand Down
1 change: 1 addition & 0 deletions changelog/13719.breaking.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Support for Python 3.9 is dropped following its end of life.
2 changes: 1 addition & 1 deletion doc/en/example/multipython.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import pytest


pythonlist = ["python3.9", "python3.10", "python3.11"]
pythonlist = ["python3.11", "python3.12", "python3.13"]


@pytest.fixture(params=pythonlist)
Expand Down
2 changes: 0 additions & 2 deletions doc/en/getting-started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ Get Started
Install ``pytest``
----------------------------------------

``pytest`` requires: Python 3.8+ or PyPy3.

1. Run the following command in your command line:

.. code-block:: bash
Expand Down
4 changes: 2 additions & 2 deletions doc/en/how-to/skipping.rst
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,14 @@ It is also possible to skip the whole module using

If you wish to skip something conditionally then you can use ``skipif`` instead.
Here is an example of marking a test function to be skipped
when run on an interpreter earlier than Python3.10:
when run on an interpreter earlier than Python3.13:

.. code-block:: python

import sys


@pytest.mark.skipif(sys.version_info < (3, 10), reason="requires python3.10 or higher")
@pytest.mark.skipif(sys.version_info < (3, 13), reason="requires python3.13 or higher")
def test_function(): ...

If the condition evaluates to ``True`` during collection, the test function will be skipped,
Expand Down
4 changes: 1 addition & 3 deletions doc/en/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ The ``pytest`` framework makes it easy to write small, readable tests, and can
scale to support complex functional testing for applications and libraries.


``pytest`` requires: Python 3.8+ or PyPy3.

**PyPI package name**: :pypi:`pytest`

A quick example
Expand Down Expand Up @@ -104,7 +102,7 @@ Features

- Can run :ref:`unittest <unittest>` (including trial) test suites out of the box

- Python 3.8+ or PyPy 3
- Python 3.10+ or PyPy 3
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one was not removed ?


- Rich plugin architecture, with over 1300+ :ref:`external plugins <plugin-list>` and thriving community

Expand Down
11 changes: 5 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ authors = [
{ name = "Florian Bruhin" },
{ name = "Others (See AUTHORS)" },
]
requires-python = ">=3.9"
requires-python = ">=3.10"
classifiers = [
"Development Status :: 6 - Mature",
"Intended Audience :: Developers",
Expand All @@ -33,7 +33,6 @@ classifiers = [
"Operating System :: POSIX",
"Operating System :: Unix",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
Expand Down Expand Up @@ -86,10 +85,10 @@ write_to = "src/_pytest/_version.py"

[tool.black]
# See https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#t-target-version
target-version = [ "py39", "py310", "py311", "py312", "py313" ]
target-version = [ "py310", "py311", "py312", "py313" ]

[tool.ruff]
target-version = "py39"
target-version = "py310"
line-length = 88
src = [
"src",
Expand Down Expand Up @@ -520,7 +519,7 @@ files = [
mypy_path = [
"src",
]
python_version = "3.9"
python_version = "3.10"
check_untyped_defs = true
disallow_any_generics = true
disallow_untyped_defs = true
Expand All @@ -543,7 +542,7 @@ include = [
extraPaths = [
"src",
]
pythonVersion = "3.9"
pythonVersion = "3.10"
typeCheckingMode = "basic"
reportMissingImports = "none"
reportMissingModuleSource = "none"
Loading
Loading