Compare commits
10 Commits
main
...
graingert-
Author | SHA1 | Date |
---|---|---|
|
662fc9c012 | |
|
db62b80e8d | |
|
4821a41967 | |
|
ff12e083c5 | |
|
6e40458fc1 | |
|
e74a6da699 | |
|
5e6dc297c2 | |
|
5ba3351b52 | |
|
f34091f0ec | |
|
dc2080f3be |
|
@ -29,5 +29,3 @@ exclude_lines =
|
|||
|
||||
^\s*if TYPE_CHECKING:
|
||||
^\s*@overload( |$)
|
||||
|
||||
^\s*@pytest\.mark\.xfail
|
||||
|
|
|
@ -23,13 +23,6 @@ afc607cfd81458d4e4f3b1f3cf8cc931b933907e
|
|||
5f95dce95602921a70bfbc7d8de2f7712c5e4505
|
||||
# ran pyupgrade-docs again
|
||||
75d0b899bbb56d6849e9d69d83a9426ed3f43f8b
|
||||
|
||||
# move argument parser to own file
|
||||
c9df77cbd6a365dcb73c39618e4842711817e871
|
||||
# Replace reorder-python-imports by isort due to black incompatibility (#11896)
|
||||
8b54596639f41dfac070030ef20394b9001fe63c
|
||||
# Run blacken-docs with black's 2024's style
|
||||
4546d5445aaefe6a03957db028c263521dfb5c4b
|
||||
# Migration to ruff / ruff format
|
||||
4588653b2497ed25976b7aaff225b889fb476756
|
||||
# Use format specifiers instead of percent format
|
||||
4788165e69d08e10fc6b9c0124083fb358e2e9b0
|
|
@ -1,20 +0,0 @@
|
|||
---
|
||||
|
||||
branch-protection-check-name: Changelog entry
|
||||
action-hints:
|
||||
check-title-prefix: "Chronographer: "
|
||||
external-docs-url: >-
|
||||
https://docs.pytest.org/en/latest/contributing.html#preparing-pull-requests
|
||||
inline-markdown: >-
|
||||
See
|
||||
https://docs.pytest.org/en/latest/contributing.html#preparing-pull-requests
|
||||
for details.
|
||||
enforce-name:
|
||||
suffix: .rst
|
||||
exclude:
|
||||
humans:
|
||||
- pyup-bot
|
||||
labels:
|
||||
skip-changelog: skip news
|
||||
|
||||
...
|
|
@ -1,7 +0,0 @@
|
|||
---
|
||||
|
||||
backport_branch_prefix: patchback/backports/
|
||||
backport_label_prefix: 'backport ' # IMPORTANT: the labels are space-delimited
|
||||
# target_branch_prefix: '' # The project's backport branches are non-prefixed
|
||||
|
||||
...
|
|
@ -0,0 +1,51 @@
|
|||
name: backport
|
||||
|
||||
on:
|
||||
# Note that `pull_request_target` has security implications:
|
||||
# https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
|
||||
# In particular:
|
||||
# - Only allow triggers that can be used only be trusted users
|
||||
# - Don't execute any code from the target branch
|
||||
# - Don't use cache
|
||||
pull_request_target:
|
||||
types: [labeled]
|
||||
|
||||
# Set permissions at the job level.
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
backport:
|
||||
if: startsWith(github.event.label.name, 'backport ') && github.event.pull_request.merged
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
persist-credentials: true
|
||||
|
||||
- name: Create backport PR
|
||||
run: |
|
||||
set -eux
|
||||
|
||||
git config --global user.name "pytest bot"
|
||||
git config --global user.email "pytestbot@gmail.com"
|
||||
|
||||
label='${{ github.event.label.name }}'
|
||||
target_branch="${label#backport }"
|
||||
backport_branch=backport-${{ github.event.number }}-to-"${target_branch}"
|
||||
subject="[$target_branch] $(gh pr view --json title -q .title ${{ github.event.number }})"
|
||||
|
||||
git checkout origin/"${target_branch}" -b "${backport_branch}"
|
||||
git cherry-pick -x --mainline 1 ${{ github.event.pull_request.merge_commit_sha }}
|
||||
git commit --amend --message "$subject"
|
||||
git push --set-upstream origin --force-with-lease "${backport_branch}"
|
||||
gh pr create \
|
||||
--base "${target_branch}" \
|
||||
--title "${subject}" \
|
||||
--body "Backport of PR #${{ github.event.number }} to $target_branch branch. PR created by backport workflow."
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
@ -19,11 +19,6 @@ jobs:
|
|||
SETUPTOOLS_SCM_PRETEND_VERSION: ${{ github.event.inputs.version }}
|
||||
timeout-minutes: 10
|
||||
|
||||
# Required by attest-build-provenance-github.
|
||||
permissions:
|
||||
id-token: write
|
||||
attestations: write
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
|
@ -31,9 +26,7 @@ jobs:
|
|||
persist-credentials: false
|
||||
|
||||
- name: Build and Check Package
|
||||
uses: hynek/build-and-inspect-python-package@v2.6.0
|
||||
with:
|
||||
attest-build-provenance-github: 'true'
|
||||
uses: hynek/build-and-inspect-python-package@v1.5
|
||||
|
||||
deploy:
|
||||
if: github.repository == 'pytest-dev/pytest'
|
||||
|
@ -48,20 +41,20 @@ jobs:
|
|||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Download Package
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: Packages
|
||||
path: dist
|
||||
|
||||
- name: Publish package to PyPI
|
||||
uses: pypa/gh-action-pypi-publish@v1.9.0
|
||||
uses: pypa/gh-action-pypi-publish@v1.8.10
|
||||
|
||||
- name: Push tag
|
||||
run: |
|
||||
git config user.name "pytest bot"
|
||||
git config user.email "pytestbot@gmail.com"
|
||||
git tag --annotate --message=v${{ github.event.inputs.version }} ${{ github.event.inputs.version }} ${{ github.sha }}
|
||||
git push origin ${{ github.event.inputs.version }}
|
||||
git tag --annotate --message=v${{ github.event.inputs.version }} v${{ github.event.inputs.version }} ${{ github.sha }}
|
||||
git push origin v${{ github.event.inputs.version }}
|
||||
|
||||
release-notes:
|
||||
|
||||
|
@ -79,14 +72,8 @@ jobs:
|
|||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
|
||||
- name: Download Package
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: Packages
|
||||
path: dist
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: "3.11"
|
||||
|
||||
|
@ -95,14 +82,9 @@ jobs:
|
|||
python -m pip install --upgrade pip
|
||||
pip install --upgrade tox
|
||||
|
||||
- name: Generate release notes
|
||||
- name: Publish GitHub release notes
|
||||
env:
|
||||
GH_RELEASE_NOTES_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
sudo apt-get install pandoc
|
||||
tox -e generate-gh-release-notes -- ${{ github.event.inputs.version }} scripts/latest-release-notes.md
|
||||
|
||||
- name: Publish GitHub Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
body_path: scripts/latest-release-notes.md
|
||||
files: dist/*
|
||||
tag_name: ${{ github.event.inputs.version }}
|
||||
tox -e publish-gh-release-notes
|
||||
|
|
|
@ -32,7 +32,7 @@ jobs:
|
|||
fetch-depth: 0
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: "3.8"
|
||||
|
||||
|
|
|
@ -10,14 +10,14 @@ jobs:
|
|||
permissions:
|
||||
issues: write
|
||||
steps:
|
||||
- uses: actions/stale@v9
|
||||
- uses: actions/stale@v8
|
||||
with:
|
||||
debug-only: false
|
||||
days-before-issue-stale: 14
|
||||
days-before-issue-close: 7
|
||||
only-labels: "status: needs information"
|
||||
stale-issue-label: "stale"
|
||||
stale-issue-message: "This issue is stale because it has the `status: needs information` label and requested follow-up information was not provided for 14 days."
|
||||
close-issue-message: "This issue was closed because it has the `status: needs information` label and follow-up information has not been provided for 7 days since being marked as stale."
|
||||
stale-issue-message: "This issue is stale because it has been open for 14 days with no activity."
|
||||
close-issue-message: "This issue was closed because it has been inactive for 7 days since being marked as stale."
|
||||
days-before-pr-stale: -1
|
||||
days-before-pr-close: -1
|
||||
|
|
|
@ -14,11 +14,6 @@ on:
|
|||
branches:
|
||||
- main
|
||||
- "[0-9]+.[0-9]+.x"
|
||||
types:
|
||||
- opened # default
|
||||
- synchronize # default
|
||||
- reopened # default
|
||||
- ready_for_review # used in PRs created from the release workflow
|
||||
|
||||
env:
|
||||
PYTEST_ADDOPTS: "--color=yes"
|
||||
|
@ -40,7 +35,7 @@ jobs:
|
|||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
- name: Build and Check Package
|
||||
uses: hynek/build-and-inspect-python-package@v2.6.0
|
||||
uses: hynek/build-and-inspect-python-package@v1.5
|
||||
|
||||
build:
|
||||
needs: [package]
|
||||
|
@ -60,7 +55,6 @@ jobs:
|
|||
"windows-py310",
|
||||
"windows-py311",
|
||||
"windows-py312",
|
||||
"windows-py313",
|
||||
|
||||
"ubuntu-py38",
|
||||
"ubuntu-py38-pluggy",
|
||||
|
@ -69,14 +63,12 @@ jobs:
|
|||
"ubuntu-py310",
|
||||
"ubuntu-py311",
|
||||
"ubuntu-py312",
|
||||
"ubuntu-py313",
|
||||
"ubuntu-pypy3",
|
||||
|
||||
"macos-py38",
|
||||
"macos-py39",
|
||||
"macos-py310",
|
||||
"macos-py312",
|
||||
"macos-py313",
|
||||
|
||||
"doctesting",
|
||||
"plugins",
|
||||
|
@ -105,13 +97,9 @@ jobs:
|
|||
os: windows-latest
|
||||
tox_env: "py311"
|
||||
- name: "windows-py312"
|
||||
python: "3.12"
|
||||
python: "3.12-dev"
|
||||
os: windows-latest
|
||||
tox_env: "py312"
|
||||
- name: "windows-py313"
|
||||
python: "3.13-dev"
|
||||
os: windows-latest
|
||||
tox_env: "py313"
|
||||
|
||||
- name: "ubuntu-py38"
|
||||
python: "3.8"
|
||||
|
@ -140,15 +128,10 @@ jobs:
|
|||
tox_env: "py311"
|
||||
use_coverage: true
|
||||
- name: "ubuntu-py312"
|
||||
python: "3.12"
|
||||
python: "3.12-dev"
|
||||
os: ubuntu-latest
|
||||
tox_env: "py312"
|
||||
use_coverage: true
|
||||
- name: "ubuntu-py313"
|
||||
python: "3.13-dev"
|
||||
os: ubuntu-latest
|
||||
tox_env: "py313"
|
||||
use_coverage: true
|
||||
- name: "ubuntu-pypy3"
|
||||
python: "pypy-3.8"
|
||||
os: ubuntu-latest
|
||||
|
@ -168,16 +151,12 @@ jobs:
|
|||
os: macos-latest
|
||||
tox_env: "py310-xdist"
|
||||
- name: "macos-py312"
|
||||
python: "3.12"
|
||||
python: "3.12-dev"
|
||||
os: macos-latest
|
||||
tox_env: "py312-xdist"
|
||||
- name: "macos-py313"
|
||||
python: "3.13-dev"
|
||||
os: macos-latest
|
||||
tox_env: "py313-xdist"
|
||||
|
||||
- name: "plugins"
|
||||
python: "3.12"
|
||||
python: "3.9"
|
||||
os: ubuntu-latest
|
||||
tox_env: "plugins"
|
||||
|
||||
|
@ -187,26 +166,6 @@ jobs:
|
|||
tox_env: "doctesting"
|
||||
use_coverage: true
|
||||
|
||||
continue-on-error: >-
|
||||
${{
|
||||
contains(
|
||||
fromJSON(
|
||||
'[
|
||||
"windows-py38-pluggy",
|
||||
"windows-py313",
|
||||
"ubuntu-py38-pluggy",
|
||||
"ubuntu-py38-freeze",
|
||||
"ubuntu-py313",
|
||||
"macos-py38",
|
||||
"macos-py313"
|
||||
]'
|
||||
),
|
||||
matrix.name
|
||||
)
|
||||
&& true
|
||||
|| false
|
||||
}}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
|
@ -214,13 +173,13 @@ jobs:
|
|||
persist-credentials: false
|
||||
|
||||
- name: Download Package
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: Packages
|
||||
path: dist
|
||||
|
||||
- name: Set up Python ${{ matrix.python }}
|
||||
uses: actions/setup-python@v5
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: ${{ matrix.python }}
|
||||
check-latest: ${{ endsWith(matrix.python, '-dev') }}
|
||||
|
@ -246,22 +205,9 @@ jobs:
|
|||
|
||||
- name: Upload coverage to Codecov
|
||||
if: "matrix.use_coverage"
|
||||
uses: codecov/codecov-action@v4
|
||||
uses: codecov/codecov-action@v3
|
||||
continue-on-error: true
|
||||
with:
|
||||
fail_ci_if_error: false
|
||||
fail_ci_if_error: true
|
||||
files: ./coverage.xml
|
||||
verbose: true
|
||||
|
||||
check: # This job does nothing and is only used for the branch protection
|
||||
if: always()
|
||||
|
||||
needs:
|
||||
- build
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Decide whether the needed jobs succeeded or failed
|
||||
uses: re-actors/alls-green@223e4bb7a751b91f43eda76992bcfbf23b8b0302
|
||||
with:
|
||||
jobs: ${{ toJSON(needs) }}
|
||||
|
|
|
@ -25,12 +25,12 @@ jobs:
|
|||
fetch-depth: 0
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v5
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: "3.11"
|
||||
cache: pip
|
||||
- name: requests-cache
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.cache/pytest-plugin-list/
|
||||
key: plugins-http-cache-${{ github.run_id }} # Can use time based key as well
|
||||
|
@ -46,8 +46,7 @@ jobs:
|
|||
run: python scripts/update-plugin-list.py
|
||||
|
||||
- name: Create Pull Request
|
||||
id: pr
|
||||
uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c
|
||||
uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38
|
||||
with:
|
||||
commit-message: '[automated] Update plugin list'
|
||||
author: 'pytest bot <pytestbot@users.noreply.github.com>'
|
||||
|
@ -56,13 +55,3 @@ jobs:
|
|||
branch-suffix: short-commit-hash
|
||||
title: '[automated] Update plugin list'
|
||||
body: '[automated] Update plugin list'
|
||||
draft: true
|
||||
|
||||
- name: Instruct the maintainers to trigger CI by undrafting the PR
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
run: >-
|
||||
gh pr comment
|
||||
--body 'Please mark the PR as ready for review to trigger PR checks.'
|
||||
--repo '${{ github.repository }}'
|
||||
'${{ steps.pr.outputs.pull-request-number }}'
|
||||
|
|
|
@ -25,6 +25,7 @@ src/_pytest/_version.py
|
|||
|
||||
doc/*/_build
|
||||
doc/*/.doctrees
|
||||
doc/*/_changelog_towncrier_draft.rst
|
||||
build/
|
||||
dist/
|
||||
*.egg-info
|
||||
|
@ -50,7 +51,6 @@ coverage.xml
|
|||
.settings
|
||||
.vscode
|
||||
__pycache__/
|
||||
.python-version
|
||||
|
||||
# generated by pip
|
||||
pip-wheel-metadata/
|
||||
|
|
|
@ -1,62 +1,77 @@
|
|||
repos:
|
||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||
rev: "v0.4.10"
|
||||
hooks:
|
||||
- id: ruff
|
||||
args: ["--fix"]
|
||||
- id: ruff-format
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v4.6.0
|
||||
- repo: https://github.com/psf/black
|
||||
rev: 23.9.1
|
||||
hooks:
|
||||
- id: trailing-whitespace
|
||||
- id: end-of-file-fixer
|
||||
- id: check-yaml
|
||||
- repo: https://github.com/adamchainz/blacken-docs
|
||||
- id: black
|
||||
args: [--safe, --quiet]
|
||||
- repo: https://github.com/asottile/blacken-docs
|
||||
rev: 1.16.0
|
||||
hooks:
|
||||
- id: blacken-docs
|
||||
additional_dependencies: [black==24.1.1]
|
||||
additional_dependencies: [black==23.7.0]
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v4.5.0
|
||||
hooks:
|
||||
- id: trailing-whitespace
|
||||
- id: end-of-file-fixer
|
||||
- id: fix-encoding-pragma
|
||||
args: [--remove]
|
||||
- id: check-yaml
|
||||
- id: debug-statements
|
||||
exclude: _pytest/(debugging|hookspec).py
|
||||
language_version: python3
|
||||
- repo: https://github.com/PyCQA/autoflake
|
||||
rev: v2.2.1
|
||||
hooks:
|
||||
- id: autoflake
|
||||
name: autoflake
|
||||
args: ["--in-place", "--remove-unused-variables", "--remove-all-unused-imports"]
|
||||
language: python
|
||||
files: \.py$
|
||||
- repo: https://github.com/PyCQA/flake8
|
||||
rev: 6.1.0
|
||||
hooks:
|
||||
- id: flake8
|
||||
language_version: python3
|
||||
additional_dependencies:
|
||||
- flake8-typing-imports==1.12.0
|
||||
- flake8-docstrings==1.5.0
|
||||
- repo: https://github.com/asottile/reorder-python-imports
|
||||
rev: v3.12.0
|
||||
hooks:
|
||||
- id: reorder-python-imports
|
||||
args: ['--application-directories=.:src', --py38-plus]
|
||||
- repo: https://github.com/asottile/pyupgrade
|
||||
rev: v3.15.0
|
||||
hooks:
|
||||
- id: pyupgrade
|
||||
args: [--py38-plus]
|
||||
- repo: https://github.com/asottile/setup-cfg-fmt
|
||||
rev: v2.5.0
|
||||
hooks:
|
||||
- id: setup-cfg-fmt
|
||||
args: ["--max-py-version=3.12", "--include-version-classifiers"]
|
||||
- repo: https://github.com/pre-commit/pygrep-hooks
|
||||
rev: v1.10.0
|
||||
hooks:
|
||||
- id: python-use-type-annotations
|
||||
- repo: https://github.com/pre-commit/mirrors-mypy
|
||||
rev: v1.10.0
|
||||
rev: v1.5.1
|
||||
hooks:
|
||||
- id: mypy
|
||||
files: ^(src/|testing/|scripts/)
|
||||
files: ^(src/|testing/)
|
||||
args: []
|
||||
additional_dependencies:
|
||||
- iniconfig>=1.1.0
|
||||
- attrs>=19.2.0
|
||||
- pluggy>=1.5.0
|
||||
- packaging
|
||||
- tomli
|
||||
- types-pkg_resources
|
||||
- types-tabulate
|
||||
# for mypy running on python>=3.11 since exceptiongroup is only a dependency
|
||||
# on <3.11
|
||||
- exceptiongroup>=1.0.0rc8
|
||||
- repo: https://github.com/tox-dev/pyproject-fmt
|
||||
rev: "2.1.3"
|
||||
hooks:
|
||||
- id: pyproject-fmt
|
||||
# https://pyproject-fmt.readthedocs.io/en/latest/#calculating-max-supported-python-version
|
||||
additional_dependencies: ["tox>=4.9"]
|
||||
- repo: https://github.com/asottile/pyupgrade
|
||||
rev: v3.16.0
|
||||
hooks:
|
||||
- id: pyupgrade
|
||||
stages: [manual]
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: pylint
|
||||
name: pylint
|
||||
entry: pylint
|
||||
language: system
|
||||
types: [python]
|
||||
args: ["-rn", "-sn", "--fail-on=I"]
|
||||
stages: [manual]
|
||||
- id: rst
|
||||
name: rst
|
||||
entry: rst-lint --encoding utf-8
|
||||
|
@ -66,50 +81,9 @@ repos:
|
|||
- id: changelogs-rst
|
||||
name: changelog filenames
|
||||
language: fail
|
||||
entry: >-
|
||||
changelog files must be named
|
||||
####.(
|
||||
breaking
|
||||
| deprecation
|
||||
| feature
|
||||
| improvement
|
||||
| bugfix
|
||||
| vendor
|
||||
| doc
|
||||
| packaging
|
||||
| contrib
|
||||
| misc
|
||||
)(.#)?(.rst)?
|
||||
exclude: >-
|
||||
(?x)
|
||||
^
|
||||
changelog/(
|
||||
\.gitignore
|
||||
|\d+\.(
|
||||
breaking
|
||||
|deprecation
|
||||
|feature
|
||||
|improvement
|
||||
|bugfix
|
||||
|vendor
|
||||
|doc
|
||||
|packaging
|
||||
|contrib
|
||||
|misc
|
||||
)(\.\d+)?(\.rst)?
|
||||
|README\.rst
|
||||
|_template\.rst
|
||||
)
|
||||
$
|
||||
entry: 'changelog files must be named ####.(breaking|bugfix|deprecation|doc|feature|improvement|trivial|vendor).rst'
|
||||
exclude: changelog/(\d+\.(breaking|bugfix|deprecation|doc|feature|improvement|trivial|vendor).rst|README.rst|_template.rst)
|
||||
files: ^changelog/
|
||||
- id: changelogs-user-role
|
||||
name: Changelog files should use a non-broken :user:`name` role
|
||||
language: pygrep
|
||||
entry: :user:([^`]+`?|`[^`]+[\s,])
|
||||
pass_filenames: true
|
||||
types:
|
||||
- file
|
||||
- rst
|
||||
- id: py-deprecated
|
||||
name: py library is deprecated
|
||||
language: pygrep
|
||||
|
|
|
@ -9,21 +9,12 @@ python:
|
|||
path: .
|
||||
- requirements: doc/en/requirements.txt
|
||||
|
||||
sphinx:
|
||||
configuration: doc/en/conf.py
|
||||
fail_on_warning: true
|
||||
|
||||
build:
|
||||
os: ubuntu-24.04
|
||||
os: ubuntu-20.04
|
||||
tools:
|
||||
python: >-
|
||||
3.12
|
||||
python: "3.9"
|
||||
apt_packages:
|
||||
- inkscape
|
||||
jobs:
|
||||
post_checkout:
|
||||
- git fetch --unshallow || true
|
||||
- git fetch --tags || true
|
||||
|
||||
formats:
|
||||
- epub
|
38
AUTHORS
38
AUTHORS
|
@ -36,7 +36,6 @@ Andrey Paramonov
|
|||
Andrzej Klajnert
|
||||
Andrzej Ostrowski
|
||||
Andy Freeland
|
||||
Anita Hammer
|
||||
Anthon van der Neut
|
||||
Anthony Shaw
|
||||
Anthony Sottile
|
||||
|
@ -49,18 +48,14 @@ Ariel Pillemer
|
|||
Armin Rigo
|
||||
Aron Coyle
|
||||
Aron Curzon
|
||||
Arthur Richard
|
||||
Ashish Kurmi
|
||||
Aviral Verma
|
||||
Aviv Palivoda
|
||||
Babak Keyvani
|
||||
Barney Gale
|
||||
Ben Brown
|
||||
Ben Gartner
|
||||
Ben Leith
|
||||
Ben Webb
|
||||
Benjamin Peterson
|
||||
Benjamin Schubert
|
||||
Bernard Pratz
|
||||
Bo Wu
|
||||
Bob Ippolito
|
||||
|
@ -95,14 +90,12 @@ Christopher Dignam
|
|||
Christopher Gilling
|
||||
Claire Cecil
|
||||
Claudio Madotto
|
||||
Clément M.T. Robert
|
||||
CrazyMerlyn
|
||||
Cristian Vera
|
||||
Cyrus Maden
|
||||
Damian Skrzypczak
|
||||
Daniel Grana
|
||||
Daniel Hahler
|
||||
Daniel Miller
|
||||
Daniel Nuri
|
||||
Daniel Sánchez Castelló
|
||||
Daniel Valenzuela Zenteno
|
||||
|
@ -120,7 +113,6 @@ Daw-Ran Liou
|
|||
Debi Mishra
|
||||
Denis Kirisov
|
||||
Denivy Braiam Rück
|
||||
Dheeraj C K
|
||||
Dhiren Serai
|
||||
Diego Russo
|
||||
Dmitry Dygalo
|
||||
|
@ -131,8 +123,6 @@ Edison Gustavo Muenz
|
|||
Edoardo Batini
|
||||
Edson Tadeu M. Manoel
|
||||
Eduardo Schettino
|
||||
Edward Haigh
|
||||
Eero Vaher
|
||||
Eli Boyarski
|
||||
Elizaveta Shashkova
|
||||
Éloi Rivard
|
||||
|
@ -140,17 +130,13 @@ Endre Galaczi
|
|||
Eric Hunsberger
|
||||
Eric Liu
|
||||
Eric Siegerman
|
||||
Eric Yuan
|
||||
Erik Aronesty
|
||||
Erik Hasse
|
||||
Erik M. Bray
|
||||
Evan Kepner
|
||||
Evgeny Seliverstov
|
||||
Fabian Sturm
|
||||
Fabien Zarifian
|
||||
Fabio Zadrozny
|
||||
Farbod Ahmadian
|
||||
faph
|
||||
Felix Hofstätter
|
||||
Felix Nieuwenhuizen
|
||||
Feng Ma
|
||||
|
@ -193,7 +179,6 @@ Jake VanderPlas
|
|||
Jakob van Santen
|
||||
Jakub Mitoraj
|
||||
James Bourbeau
|
||||
James Frost
|
||||
Jan Balster
|
||||
Janne Vanhala
|
||||
Jason R. Coombs
|
||||
|
@ -202,7 +187,6 @@ Javier Romero
|
|||
Jeff Rackauckas
|
||||
Jeff Widman
|
||||
Jenni Rinker
|
||||
Jens Tröger
|
||||
John Eddie Ayson
|
||||
John Litborn
|
||||
John Towler
|
||||
|
@ -213,7 +197,6 @@ Jordan Guymon
|
|||
Jordan Moldow
|
||||
Jordan Speicher
|
||||
Joseph Hunkeler
|
||||
Joseph Sawaya
|
||||
Josh Karpel
|
||||
Joshua Bronson
|
||||
Jurko Gospodnetić
|
||||
|
@ -242,11 +225,9 @@ Kyle Altendorf
|
|||
Lawrence Mitchell
|
||||
Lee Kamentsky
|
||||
Lev Maximov
|
||||
Levon Saldamli
|
||||
Lewis Cowles
|
||||
Llandy Riveron Del Risco
|
||||
Loic Esteve
|
||||
lovetheguitar
|
||||
Lukas Bednar
|
||||
Luke Murphy
|
||||
Maciek Fijalkowski
|
||||
|
@ -258,11 +239,9 @@ Marc Mueller
|
|||
Marc Schlaich
|
||||
Marcelo Duarte Trevisani
|
||||
Marcin Bachry
|
||||
Marc Bresson
|
||||
Marco Gorelli
|
||||
Mark Abramowitz
|
||||
Mark Dickinson
|
||||
Mark Vong
|
||||
Marko Pacak
|
||||
Markus Unterwaditzer
|
||||
Martijn Faassen
|
||||
|
@ -283,9 +262,7 @@ Michael Droettboom
|
|||
Michael Goerz
|
||||
Michael Krebs
|
||||
Michael Seifert
|
||||
Michael Vogt
|
||||
Michal Wajszczuk
|
||||
Michał Górny
|
||||
Michał Zięba
|
||||
Mickey Pashov
|
||||
Mihai Capotă
|
||||
|
@ -294,18 +271,14 @@ Mike Hoyle (hoylemd)
|
|||
Mike Lundy
|
||||
Milan Lesnek
|
||||
Miro Hrončok
|
||||
mrbean-bremen
|
||||
Nathan Goldbaum
|
||||
Nathaniel Compton
|
||||
Nathaniel Waisbrot
|
||||
Ned Batchelder
|
||||
Neil Martin
|
||||
Neven Mundar
|
||||
Nicholas Devenish
|
||||
Nicholas Murphy
|
||||
Niclas Olofsson
|
||||
Nicolas Delaby
|
||||
Nico Vidal
|
||||
Nikolay Kondratyev
|
||||
Nipunn Koorapati
|
||||
Oleg Pidsadnyi
|
||||
|
@ -318,7 +291,6 @@ Ondřej Súkup
|
|||
Oscar Benjamin
|
||||
Parth Patel
|
||||
Patrick Hayes
|
||||
Patrick Lannigan
|
||||
Paul Müller
|
||||
Paul Reece
|
||||
Pauli Virtanen
|
||||
|
@ -331,7 +303,6 @@ Pierre Sassoulas
|
|||
Pieter Mulder
|
||||
Piotr Banaszkiewicz
|
||||
Piotr Helm
|
||||
Poulami Sau
|
||||
Prakhar Gurunani
|
||||
Prashant Anand
|
||||
Prashant Sharma
|
||||
|
@ -359,16 +330,13 @@ Ronny Pfannschmidt
|
|||
Ross Lawley
|
||||
Ruaridh Williamson
|
||||
Russel Winder
|
||||
Russell Martin
|
||||
Ryan Puddephatt
|
||||
Ryan Wooden
|
||||
Sadra Barikbin
|
||||
Saiprasad Kale
|
||||
Samuel Colvin
|
||||
Samuel Dion-Girardeau
|
||||
Samuel Jirovec
|
||||
Samuel Searles-Bryant
|
||||
Samuel Therrien (Avasam)
|
||||
Samuele Pedroni
|
||||
Sanket Duthade
|
||||
Sankt Petersbug
|
||||
|
@ -395,7 +363,6 @@ Stefano Taschini
|
|||
Steffen Allner
|
||||
Stephan Obermann
|
||||
Sven-Hendrik Haase
|
||||
Sviatoslav Sydorenko
|
||||
Sylvain Marié
|
||||
Tadek Teleżyński
|
||||
Takafumi Arakaki
|
||||
|
@ -430,14 +397,12 @@ Victor Rodriguez
|
|||
Victor Uriarte
|
||||
Vidar T. Fauske
|
||||
Vijay Arora
|
||||
Virendra Patil
|
||||
Virgil Dupras
|
||||
Vitaly Lashmanov
|
||||
Vivaan Verma
|
||||
Vlad Dragos
|
||||
Vlad Radziuk
|
||||
Vladyslav Rachek
|
||||
Volodymyr Kochetkov
|
||||
Volodymyr Piskun
|
||||
Wei Lin
|
||||
Wil Cooley
|
||||
|
@ -448,14 +413,11 @@ Xixi Zhao
|
|||
Xuan Luong
|
||||
Xuecong Liao
|
||||
Yannick Péroux
|
||||
Yao Xiao
|
||||
Yoav Caspi
|
||||
Yuliang Shao
|
||||
Yusuke Kadowaki
|
||||
Yutian Li
|
||||
Yuval Shimon
|
||||
Zac Hatfield-Dodds
|
||||
Zach Snicker
|
||||
Zachary Kneupper
|
||||
Zachary OBrien
|
||||
Zhouxin Qiu
|
||||
|
|
|
@ -1,10 +1,14 @@
|
|||
============================
|
||||
Contributing
|
||||
Contribution getting started
|
||||
============================
|
||||
|
||||
Contributions are highly welcomed and appreciated. Every little bit of help counts,
|
||||
so do not hesitate!
|
||||
|
||||
.. contents::
|
||||
:depth: 2
|
||||
:backlinks: none
|
||||
|
||||
|
||||
.. _submitfeedback:
|
||||
|
||||
|
@ -124,7 +128,7 @@ For example:
|
|||
Submitting Plugins to pytest-dev
|
||||
--------------------------------
|
||||
|
||||
Development of the pytest core, support code, and some plugins happens
|
||||
Pytest development of the core, some plugins and support code happens
|
||||
in repositories living under the ``pytest-dev`` organisations:
|
||||
|
||||
- `pytest-dev on GitHub <https://github.com/pytest-dev>`_
|
||||
|
@ -195,7 +199,7 @@ Short version
|
|||
#. Fork the repository.
|
||||
#. Fetch tags from upstream if necessary (if you cloned only main `git fetch --tags https://github.com/pytest-dev/pytest`).
|
||||
#. Enable and install `pre-commit <https://pre-commit.com>`_ to ensure style-guides and code checks are followed.
|
||||
#. Follow `PEP-8 <https://www.python.org/dev/peps/pep-0008/>`_ for naming.
|
||||
#. Follow **PEP-8** for naming and `black <https://github.com/psf/black>`_ for formatting.
|
||||
#. Tests are run using ``tox``::
|
||||
|
||||
tox -e linting,py39
|
||||
|
@ -278,7 +282,7 @@ Here is a simple overview, with pytest-specific bits:
|
|||
This command will run tests via the "tox" tool against Python 3.9
|
||||
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 now edit your local working copy and run the tests again as necessary. Please follow PEP-8 for naming.
|
||||
|
||||
You can pass different options to ``tox``. For example, to run tests on Python 3.9 and pass options to pytest
|
||||
(e.g. enter pdb on failure) to pytest you can do::
|
||||
|
@ -293,12 +297,12 @@ Here is a simple overview, with pytest-specific bits:
|
|||
When committing, ``pre-commit`` will re-format the files if necessary.
|
||||
|
||||
#. If instead of using ``tox`` you prefer to run the tests directly, then we suggest to create a virtual environment and use
|
||||
an editable install with the ``dev`` extra::
|
||||
an editable install with the ``testing`` extra::
|
||||
|
||||
$ python3 -m venv .venv
|
||||
$ source .venv/bin/activate # Linux
|
||||
$ .venv/Scripts/activate.bat # Windows
|
||||
$ pip install -e ".[dev]"
|
||||
$ pip install -e ".[testing]"
|
||||
|
||||
Afterwards, you can edit the files and run pytest normally::
|
||||
|
||||
|
|
11
README.rst
11
README.rst
|
@ -20,13 +20,16 @@
|
|||
:target: https://codecov.io/gh/pytest-dev/pytest
|
||||
:alt: Code coverage Status
|
||||
|
||||
.. image:: https://github.com/pytest-dev/pytest/actions/workflows/test.yml/badge.svg
|
||||
.. image:: https://github.com/pytest-dev/pytest/workflows/test/badge.svg
|
||||
:target: https://github.com/pytest-dev/pytest/actions?query=workflow%3Atest
|
||||
|
||||
.. image:: https://results.pre-commit.ci/badge/github/pytest-dev/pytest/main.svg
|
||||
:target: https://results.pre-commit.ci/latest/github/pytest-dev/pytest/main
|
||||
:alt: pre-commit.ci status
|
||||
|
||||
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
|
||||
:target: https://github.com/psf/black
|
||||
|
||||
.. image:: https://www.codetriage.com/pytest-dev/pytest/badges/users.svg
|
||||
:target: https://www.codetriage.com/pytest-dev/pytest
|
||||
|
||||
|
@ -94,12 +97,12 @@ Features
|
|||
- `Modular fixtures <https://docs.pytest.org/en/stable/explanation/fixtures.html>`_ for
|
||||
managing small or parametrized long-lived test resources
|
||||
|
||||
- Can run `unittest <https://docs.pytest.org/en/stable/how-to/unittest.html>`_ (or trial)
|
||||
test suites out of the box
|
||||
- Can run `unittest <https://docs.pytest.org/en/stable/how-to/unittest.html>`_ (or trial),
|
||||
`nose <https://docs.pytest.org/en/stable/how-to/nose.html>`_ test suites out of the box
|
||||
|
||||
- Python 3.8+ or PyPy3
|
||||
|
||||
- Rich plugin architecture, with over 1300+ `external plugins <https://docs.pytest.org/en/latest/reference/plugin_list.html>`_ and thriving community
|
||||
- Rich plugin architecture, with over 850+ `external plugins <https://docs.pytest.org/en/latest/reference/plugin_list.html>`_ and thriving community
|
||||
|
||||
|
||||
Documentation
|
||||
|
|
|
@ -23,9 +23,9 @@ members of the `contributors team`_ interested in receiving funding.
|
|||
|
||||
The current list of contributors receiving funding are:
|
||||
|
||||
* `@asottile`_
|
||||
* `@nicoddemus`_
|
||||
* `@The-Compiler`_
|
||||
* `@RonnyPfannschmidt`_
|
||||
|
||||
Contributors interested in receiving a part of the funds just need to submit a PR adding their
|
||||
name to the list. Contributors that want to stop receiving the funds should also submit a PR
|
||||
|
@ -55,6 +55,6 @@ funds. Just drop a line to one of the `@pytest-dev/tidelift-admins`_ or use the
|
|||
.. _`@pytest-dev/tidelift-admins`: https://github.com/orgs/pytest-dev/teams/tidelift-admins/members
|
||||
.. _`agreement`: https://tidelift.com/docs/lifting/agreement
|
||||
|
||||
.. _`@asottile`: https://github.com/asottile
|
||||
.. _`@nicoddemus`: https://github.com/nicoddemus
|
||||
.. _`@The-Compiler`: https://github.com/The-Compiler
|
||||
.. _`@RonnyPfannschmidt`: https://github.com/RonnyPfannschmidt
|
||||
|
|
|
@ -1,16 +1,12 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import sys
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import cProfile
|
||||
import pytest # NOQA
|
||||
import pstats
|
||||
|
||||
import pytest # noqa: F401
|
||||
|
||||
script = sys.argv[1:] if len(sys.argv) > 1 else ["empty.py"]
|
||||
cProfile.run(f"pytest.cmdline.main({script!r})", "prof")
|
||||
cProfile.run("pytest.cmdline.main(%r)" % script, "prof")
|
||||
p = pstats.Stats("prof")
|
||||
p.strip_dirs()
|
||||
p.sort_stats("cumulative")
|
||||
|
|
|
@ -2,11 +2,8 @@
|
|||
# 2.7.5 3.3.2
|
||||
# FilesCompleter 75.1109 69.2116
|
||||
# FastFilesCompleter 0.7383 1.0760
|
||||
from __future__ import annotations
|
||||
|
||||
import timeit
|
||||
|
||||
|
||||
imports = [
|
||||
"from argcomplete.completers import FilesCompleter as completer",
|
||||
"from _pytest._argcomplete import FastFilesCompleter as completer",
|
||||
|
|
|
@ -1,5 +1,2 @@
|
|||
from __future__ import annotations
|
||||
|
||||
|
||||
for i in range(1000):
|
||||
exec("def test_func_%d(): pass" % i)
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
SKIP = True
|
||||
|
||||
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from unittest import TestCase # noqa: F401
|
||||
|
||||
|
||||
for i in range(15000):
|
||||
exec(
|
||||
f"""
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
from __future__ import annotations
|
||||
|
||||
|
||||
for i in range(5000):
|
||||
exec(
|
||||
f"""
|
||||
|
|
|
@ -1,34 +0,0 @@
|
|||
*
|
||||
!.gitignore
|
||||
!_template.rst
|
||||
!README.rst
|
||||
!*.bugfix
|
||||
!*.bugfix.rst
|
||||
!*.bugfix.*.rst
|
||||
!*.breaking
|
||||
!*.breaking.rst
|
||||
!*.breaking.*.rst
|
||||
!*.contrib
|
||||
!*.contrib.rst
|
||||
!*.contrib.*.rst
|
||||
!*.deprecation
|
||||
!*.deprecation.rst
|
||||
!*.deprecation.*.rst
|
||||
!*.doc
|
||||
!*.doc.rst
|
||||
!*.doc.*.rst
|
||||
!*.feature
|
||||
!*.feature.rst
|
||||
!*.feature.*.rst
|
||||
!*.improvement
|
||||
!*.improvement.rst
|
||||
!*.improvement.*.rst
|
||||
!*.misc
|
||||
!*.misc.rst
|
||||
!*.misc.*.rst
|
||||
!*.packaging
|
||||
!*.packaging.rst
|
||||
!*.packaging.*.rst
|
||||
!*.vendor
|
||||
!*.vendor.rst
|
||||
!*.vendor.*.rst
|
|
@ -0,0 +1,2 @@
|
|||
Added :func:`ExceptionInfo.group_contains() <pytest.ExceptionInfo.group_contains>`, an assertion
|
||||
helper that tests if an `ExceptionGroup` contains a matching exception.
|
|
@ -0,0 +1,2 @@
|
|||
markers are now considered in the reverse mro order to ensure base class markers are considered first
|
||||
this resolves a regression.
|
|
@ -0,0 +1 @@
|
|||
Test functions returning a value other than None will now issue a :class:`pytest.PytestWarning` instead of :class:`pytest.PytestRemovedIn8Warning`, meaning this will stay a warning instead of becoming an error in the future.
|
|
@ -0,0 +1,2 @@
|
|||
Added more comprehensive set assertion rewrites for comparisons other than equality ``==``, with
|
||||
the following operations now providing better failure messages: ``!=``, ``<=``, ``>=``, ``<``, and ``>``.
|
|
@ -0,0 +1,2 @@
|
|||
:meth:`pytest.WarningsRecorder.pop` will return the most-closely-matched warning in the list,
|
||||
rather than the first warning which is an instance of the requested type.
|
|
@ -0,0 +1 @@
|
|||
Added a warning about modifying the root logger during tests when using ``caplog``.
|
|
@ -0,0 +1 @@
|
|||
Updated documentation and tests to refer to hyphonated options: replaced ``--junitxml`` with ``--junit-xml`` and ``--collectonly`` with ``--collect-only``.
|
|
@ -0,0 +1,6 @@
|
|||
``pluggy>=1.2.0`` is now required.
|
||||
|
||||
pytest now uses "new-style" hook wrappers internally, available since pluggy 1.2.0.
|
||||
See `pluggy's 1.2.0 changelog <https://pluggy.readthedocs.io/en/latest/changelog.html#pluggy-1-2-0-2023-06-21>`_ and the :ref:`updated docs <hookwrapper>` for details.
|
||||
|
||||
Plugins which want to use new-style wrappers can do so if they require this version of pytest or later.
|
|
@ -0,0 +1,11 @@
|
|||
:class:`pytest.Package` is no longer a :class:`pytest.Module` or :class:`pytest.File`.
|
||||
|
||||
The ``Package`` collector node designates a Python package, that is, a directory with an `__init__.py` file.
|
||||
Previously ``Package`` was a subtype of ``pytest.Module`` (which represents a single Python module),
|
||||
the module being the `__init__.py` file.
|
||||
This has been deemed a design mistake (see :issue:`11137` and :issue:`7777` for details).
|
||||
|
||||
The ``path`` property of ``Package`` nodes now points to the package directory instead of the ``__init__.py`` file.
|
||||
|
||||
Note that a ``Module`` node for ``__init__.py`` (which is not a ``Package``) may still exist,
|
||||
if it is picked up during collection (e.g. if you configured :confval:`python_files` to include ``__init__.py`` files).
|
|
@ -0,0 +1 @@
|
|||
- Prevent constants at the top of file from being detected as docstrings.
|
|
@ -0,0 +1 @@
|
|||
Dropped support for Python 3.7, which `reached end-of-life on 2023-06-27 <https://devguide.python.org/versions/>`__.
|
|
@ -0,0 +1,2 @@
|
|||
The (internal) ``FixtureDef.cached_result`` type has changed.
|
||||
Now the third item ``cached_result[2]``, when set, is an exception instance instead of an exception triplet.
|
|
@ -0,0 +1 @@
|
|||
If a test is skipped from inside an :ref:`xunit setup fixture <classic xunit>`, the test summary now shows the test location instead of the fixture location.
|
|
@ -0,0 +1,5 @@
|
|||
(This entry is meant to assist plugins which access private pytest internals to instantiate ``FixtureRequest`` objects.)
|
||||
|
||||
:class:`~pytest.FixtureRequest` is now an abstract class which can't be instantiated directly.
|
||||
A new concrete ``TopRequest`` subclass of ``FixtureRequest`` has been added for the ``request`` fixture in test functions,
|
||||
as counterpart to the existing ``SubRequest`` subclass for the ``request`` fixture in fixture functions.
|
|
@ -0,0 +1 @@
|
|||
Allow :func:`pytest.raises` ``match`` argument to match against `PEP-678 <https://peps.python.org/pep-0678/>` ``__notes__``.
|
|
@ -0,0 +1 @@
|
|||
Fixed ``:=`` in asserts impacting unrelated test cases.
|
|
@ -0,0 +1 @@
|
|||
Fixed crash on `parametrize(..., scope="package")` without a package present.
|
|
@ -0,0 +1,2 @@
|
|||
Fixed a bug that when there are multiple fixtures for an indirect parameter,
|
||||
the scope of the highest-scope fixture is picked for the parameter set, instead of that of the one with the narrowest scope.
|
|
@ -0,0 +1,2 @@
|
|||
Logging to a file using the ``--log-file`` option will use ``--log-level``, ``--log-format`` and ``--log-date-format`` as fallback
|
||||
if ``--log-file-level``, ``--log-file-format`` and ``--log-file-date-format`` are not provided respectively.
|
|
@ -0,0 +1,3 @@
|
|||
The :fixture:`pytester` fixture now uses the :fixture:`monkeypatch` fixture to manage the current working directory.
|
||||
If you use ``pytester`` in combination with :func:`monkeypatch.undo() <pytest.MonkeyPatch.undo>`, the CWD might get restored.
|
||||
Use :func:`monkeypatch.context() <pytest.MonkeyPatch.context>` instead.
|
|
@ -0,0 +1,2 @@
|
|||
Corrected the spelling of ``Config.ArgsSource.INVOCATION_DIR``.
|
||||
The previous spelling ``INCOVATION_DIR`` remains as an alias.
|
|
@ -0,0 +1 @@
|
|||
pluggy>=1.3.0 is now required. This adds typing to :class:`~pytest.PytestPluginManager`.
|
|
@ -0,0 +1 @@
|
|||
Handle an edge case where :data:`sys.stderr` might already be closed when :ref:`faulthandler` is tearing down.
|
|
@ -0,0 +1 @@
|
|||
:func:`pytest.deprecated_call` now also considers warnings of type :class:`FutureWarning`.
|
|
@ -0,0 +1,4 @@
|
|||
Parametrized tests now *really do* ensure that the ids given to each input are unique - for
|
||||
example, ``a, a, a0`` now results in ``a1, a2, a0`` instead of the previous (buggy) ``a0, a1, a0``.
|
||||
This necessarily means changing nodeids where these were previously colliding, and for
|
||||
readability adds an underscore when non-unique ids end in a number.
|
|
@ -1,4 +0,0 @@
|
|||
Fix reporting of teardown errors in higher-scoped fixtures when using `--maxfail` or `--stepwise`.
|
||||
|
||||
Originally added in pytest 8.0.0, but reverted in 8.0.2 due to a regression in pytest-xdist.
|
||||
This regression was fixed in pytest-xdist 3.6.1.
|
|
@ -1 +0,0 @@
|
|||
:func:`pytest.approx` now correctly handles :class:`Sequence <collections.abc.Sequence>`-like objects.
|
|
@ -1 +0,0 @@
|
|||
Documented using :envvar:`PYTEST_VERSION` to detect if code is running from within a pytest run.
|
|
@ -1,11 +0,0 @@
|
|||
Fixed a regression in pytest 8.0 where tracebacks get longer and longer when multiple
|
||||
tests fail due to a shared higher-scope fixture which raised -- by :user:`bluetech`.
|
||||
|
||||
Also fixed a similar regression in pytest 5.4 for collectors which raise during setup.
|
||||
|
||||
The fix necessitated internal changes which may affect some plugins:
|
||||
|
||||
* ``FixtureDef.cached_result[2]`` is now a tuple ``(exc, tb)``
|
||||
instead of ``exc``.
|
||||
* ``SetupState.stack`` failures are now a tuple ``(exc, tb)``
|
||||
instead of ``exc``.
|
|
@ -1,11 +0,0 @@
|
|||
Added `--xfail-tb` flag, which turns on traceback output for XFAIL results.
|
||||
|
||||
* If the `--xfail-tb` flag is not sent, tracebacks for XFAIL results are NOT shown.
|
||||
* The style of traceback for XFAIL is set with `--tb`, and can be `auto|long|short|line|native|no`.
|
||||
* Note: Even if you have `--xfail-tb` set, you won't see them if `--tb=no`.
|
||||
|
||||
Some history:
|
||||
|
||||
With pytest 8.0, `-rx` or `-ra` would not only turn on summary reports for xfail, but also report the tracebacks for xfail results. This caused issues with some projects that utilize xfail, but don't want to see all of the xfail tracebacks.
|
||||
|
||||
This change detaches xfail tracebacks from `-rx`, and now we turn on xfail tracebacks with `--xfail-tb`. With this, the default `-rx`/ `-ra` behavior is identical to pre-8.0 with respect to xfail tracebacks. While this is a behavior change, it brings default behavior back to pre-8.0.0 behavior, which ultimately was considered the better course of action.
|
|
@ -1 +0,0 @@
|
|||
12204.bugfix.rst
|
|
@ -1 +0,0 @@
|
|||
Fix collection error upon encountering an :mod:`abstract <abc>` class, including abstract `unittest.TestCase` subclasses.
|
|
@ -1,8 +0,0 @@
|
|||
Added support for keyword matching in marker expressions.
|
||||
|
||||
Now tests can be selected by marker keyword arguments.
|
||||
Supported values are :class:`int`, (unescaped) :class:`str`, :class:`bool` & :data:`None`.
|
||||
|
||||
See :ref:`marker examples <marker_keyword_expression_example>` for more information.
|
||||
|
||||
-- by :user:`lovetheguitar`
|
|
@ -1 +0,0 @@
|
|||
Fix a regression in pytest 8.0.0 where package-scoped parameterized items were not correctly reordered to minimize setups/teardowns in some cases.
|
|
@ -1 +0,0 @@
|
|||
Fix crash with `assert testcase is not None` assertion failure when re-running unittest tests using plugins like pytest-rerunfailures. Regressed in 8.2.2.
|
|
@ -1,3 +0,0 @@
|
|||
Migrated all internal type-annotations to the python3.10+ style by using the `annotations` future import.
|
||||
|
||||
-- by :user:`RonnyPfannschmidt`
|
|
@ -1,6 +0,0 @@
|
|||
The external plugin mentions in the documentation now avoid mentioning
|
||||
:std:doc:`setuptools entry-points <setuptools:index>` as the concept is
|
||||
much more generic nowadays. Instead, the terminology of "external",
|
||||
"installed", or "third-party" plugins (or packages) replaces that.
|
||||
|
||||
-- by :user:`webknjaz`
|
|
@ -1,4 +0,0 @@
|
|||
The console output now uses the "third-party plugins" terminology,
|
||||
replacing the previously established but confusing and outdated
|
||||
reference to :std:doc:`setuptools <setuptools:index>`
|
||||
-- by :user:`webknjaz`.
|
|
@ -1 +0,0 @@
|
|||
Fixed a crash when returning category ``"error"`` or ``"failed"`` with a custom test status from :hook:`pytest_report_teststatus` hook -- :user:`pbrezina`.
|
|
@ -1,13 +0,0 @@
|
|||
The change log draft preview integration has been refactored to use a
|
||||
third party extension ``sphinxcontib-towncrier``. The previous in-repo
|
||||
script was putting the change log preview file at
|
||||
:file:`doc/en/_changelog_towncrier_draft.rst`. Said file is no longer
|
||||
ignored in Git and might show up among untracked files in the
|
||||
development environments of the contributors. To address that, the
|
||||
contributors can run the following command that will clean it up:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ git clean -x -i -- doc/en/_changelog_towncrier_draft.rst
|
||||
|
||||
-- by :user:`webknjaz`
|
|
@ -1,5 +0,0 @@
|
|||
All the undocumented ``tox`` environments now have descriptions.
|
||||
They can be listed in one's development environment by invoking
|
||||
``tox -av`` in a terminal.
|
||||
|
||||
-- by :user:`webknjaz`
|
|
@ -1,11 +0,0 @@
|
|||
The changelog configuration has been updated to introduce more accurate
|
||||
audience-tailored categories. Previously, there was a ``trivial``
|
||||
change log fragment type with an unclear and broad meaning. It was
|
||||
removed and we now have ``contrib``, ``misc`` and ``packaging`` in
|
||||
place of it.
|
||||
|
||||
The new change note types target the readers who are downstream
|
||||
packagers and project contributors. Additionally, the miscellaneous
|
||||
section is kept for unspecified updates that do not fit anywhere else.
|
||||
|
||||
-- by :user:`webknjaz`
|
|
@ -1,7 +0,0 @@
|
|||
The UX of the GitHub automation making pull requests to update the
|
||||
plugin list has been updated. Previously, the maintainers had to close
|
||||
the automatically created pull requests and re-open them to trigger the
|
||||
CI runs. From now on, they only need to click the `Ready for review`
|
||||
button instead.
|
||||
|
||||
-- by :user:`webknjaz`
|
|
@ -1 +0,0 @@
|
|||
Improve handling of invalid regex patterns in :func:`pytest.raises(match=r'...') <pytest.raises>` by providing a clear error message.
|
|
@ -1,4 +0,0 @@
|
|||
The ``:pull:`` RST role has been replaced with a shorter
|
||||
``:pr:`` due to starting to use the implementation from
|
||||
the third-party :pypi:`sphinx-issues` Sphinx extension
|
||||
-- by :user:`webknjaz`.
|
|
@ -1,6 +0,0 @@
|
|||
The coverage reporting configuration has been updated to exclude
|
||||
pytest's own tests marked as expected to fail from the coverage
|
||||
report. This has an effect of reducing the influence of flaky
|
||||
tests on the resulting number.
|
||||
|
||||
-- by :user:`webknjaz`
|
|
@ -1,7 +0,0 @@
|
|||
The ``extlinks`` Sphinx extension is no longer enabled. The ``:bpo:``
|
||||
role it used to declare has been removed with that. BPO itself has
|
||||
migrated to GitHub some years ago and it is possible to link the
|
||||
respective issues by using their GitHub issue numbers and the
|
||||
``:issue:`` role that the ``sphinx-issues`` extension implements.
|
||||
|
||||
-- by :user:`webknjaz`
|
|
@ -1,3 +0,0 @@
|
|||
The ``_in_venv()`` function now detects Python virtual environments by
|
||||
checking for a :file:`pyvenv.cfg` file, ensuring reliable detection on
|
||||
various platforms -- by :user:`zachsnickers`.
|
|
@ -1 +0,0 @@
|
|||
12544.improvement.rst
|
|
@ -1,2 +0,0 @@
|
|||
Possible typos in using the ``:user:`` RST role is now being linted
|
||||
through the pre-commit tool integration -- by :user:`webknjaz`.
|
|
@ -1 +0,0 @@
|
|||
Do not truncate arguments to functions in output when running with `-vvv`.
|
|
@ -0,0 +1,3 @@
|
|||
Applying a mark to a fixture function now issues a warning: marks in fixtures never had any effect, but it is a common user error to apply a mark to a fixture (for example ``usefixtures``) and expect it to work.
|
||||
|
||||
This will become an error in the future.
|
|
@ -1,38 +0,0 @@
|
|||
The readability of assertion introspection of bound methods has been enhanced
|
||||
-- by :user:`farbodahm`, :user:`webknjaz`, :user:`obestwalter`, :user:`flub`
|
||||
and :user:`glyphack`.
|
||||
|
||||
Earlier, it was like:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
=================================== FAILURES ===================================
|
||||
_____________________________________ test _____________________________________
|
||||
|
||||
def test():
|
||||
> assert Help().fun() == 2
|
||||
E assert 1 == 2
|
||||
E + where 1 = <bound method Help.fun of <example.Help instance at 0x256a830>>()
|
||||
E + where <bound method Help.fun of <example.Help instance at 0x256a830>> = <example.Help instance at 0x256a830>.fun
|
||||
E + where <example.Help instance at 0x256a830> = Help()
|
||||
|
||||
example.py:7: AssertionError
|
||||
=========================== 1 failed in 0.03 seconds ===========================
|
||||
|
||||
|
||||
And now it's like:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
=================================== FAILURES ===================================
|
||||
_____________________________________ test _____________________________________
|
||||
|
||||
def test():
|
||||
> assert Help().fun() == 2
|
||||
E assert 1 == 2
|
||||
E + where 1 = fun()
|
||||
E + where fun = <test_local.Help object at 0x1074be230>.fun
|
||||
E + where <test_local.Help object at 0x1074be230> = Help()
|
||||
|
||||
test_local.py:13: AssertionError
|
||||
=========================== 1 failed in 0.03 seconds ===========================
|
|
@ -1 +0,0 @@
|
|||
Fixed progress percentages (the ``[ 87%]`` at the edge of the screen) sometimes not aligning correctly when running with pytest-xdist ``-n``.
|
|
@ -0,0 +1,22 @@
|
|||
**PytestRemovedIn8Warning deprecation warnings are now errors by default.**
|
||||
|
||||
Following our plan to remove deprecated features with as little disruption as
|
||||
possible, all warnings of type ``PytestRemovedIn8Warning`` now generate errors
|
||||
instead of warning messages by default.
|
||||
|
||||
**The affected features will be effectively removed in pytest 8.1**, so please consult the
|
||||
:ref:`deprecations` section in the docs for directions on how to update existing code.
|
||||
|
||||
In the pytest ``8.0.X`` series, it is possible to change the errors back into warnings as a
|
||||
stopgap measure by adding this to your ``pytest.ini`` file:
|
||||
|
||||
.. code-block:: ini
|
||||
|
||||
[pytest]
|
||||
filterwarnings =
|
||||
ignore::pytest.PytestRemovedIn8Warning
|
||||
|
||||
But this will stop working when pytest ``8.1`` is released.
|
||||
|
||||
**If you have concerns** about the removal of a specific feature, please add a
|
||||
comment to :issue:`7363`.
|
|
@ -0,0 +1 @@
|
|||
:class:`~pytest.FixtureDef` is now exported as ``pytest.FixtureDef`` for typing purposes.
|
|
@ -1 +0,0 @@
|
|||
Added timezone information to the testsuite timestamp in the JUnit XML report.
|
|
@ -0,0 +1 @@
|
|||
Removes unhelpful error message from assertion rewrite mechanism when exceptions raised in __iter__ methods, and instead treats them as un-iterable.
|
|
@ -0,0 +1,5 @@
|
|||
Running `pytest pkg/__init__.py` now collects the `pkg/__init__.py` file (module) only.
|
||||
Previously, it collected the entire `pkg` package, including other test files in the directory, but excluding tests in the `__init__.py` file itself
|
||||
(unless :confval:`python_files` was changed to allow `__init__.py` file).
|
||||
|
||||
To collect the entire package, specify just the directory: `pytest pkg`.
|
|
@ -0,0 +1 @@
|
|||
``pytest.warns`` and similar functions now capture warnings when an exception is raised inside a ``with`` block.
|
|
@ -0,0 +1,7 @@
|
|||
:func:`pytest.warns <warns>` now re-emits unmatched warnings when the context
|
||||
closes -- previously it would consume all warnings, hiding those that were not
|
||||
matched by the function.
|
||||
|
||||
While this is a new feature, we decided to announce this as a breaking change
|
||||
because many test suites are configured to error-out on warnings, and will
|
||||
therefore fail on the newly-re-emitted warnings.
|
|
@ -20,22 +20,10 @@ Each file should be named like ``<ISSUE>.<TYPE>.rst``, where
|
|||
* ``deprecation``: feature deprecation.
|
||||
* ``breaking``: a change which may break existing suites, such as feature removal or behavior change.
|
||||
* ``vendor``: changes in packages vendored in pytest.
|
||||
* ``packaging``: notes for downstreams about unobvious side effects
|
||||
and tooling. changes in the test invocation considerations and
|
||||
runtime assumptions.
|
||||
* ``contrib``: stuff that affects the contributor experience. e.g.
|
||||
Running tests, building the docs, setting up the development
|
||||
environment.
|
||||
* ``misc``: changes that are hard to assign to any of the above
|
||||
categories.
|
||||
* ``trivial``: fixing a small typo or internal change that might be noteworthy.
|
||||
|
||||
So for example: ``123.feature.rst``, ``456.bugfix.rst``.
|
||||
|
||||
.. tip::
|
||||
|
||||
See :file:`pyproject.toml` for all available categories
|
||||
(``tool.towncrier.type``).
|
||||
|
||||
If your PR fixes an issue, use that number here. If there is no issue,
|
||||
then after you submit the PR and get the PR number you can add a
|
||||
changelog using that instead.
|
||||
|
|
|
@ -1,9 +1,4 @@
|
|||
# reference: https://docs.codecov.io/docs/codecovyml-reference
|
||||
---
|
||||
|
||||
codecov:
|
||||
token: 1eca3b1f-31a2-4fb8-a8c3-138b441b50a7 #repo token
|
||||
|
||||
coverage:
|
||||
status:
|
||||
patch: true
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
<style>
|
||||
.logo {text-align: center;}
|
||||
</style>
|
||||
|
||||
<a class="logo" href="{{ pathto('contents') }}">
|
||||
<img src="{{ pathto('_static/pytest1.png', 1) }}" width="70%" height="70%" text="Pytest Logo"/>
|
||||
</a>
|
|
@ -0,0 +1,15 @@
|
|||
{#
|
||||
basic/searchbox.html with heading removed.
|
||||
#}
|
||||
{%- if pagename != "search" and builder != "singlehtml" %}
|
||||
<div id="searchbox" style="display: none" role="search">
|
||||
<div class="searchformwrapper">
|
||||
<form class="search" action="{{ pathto('search') }}" method="get">
|
||||
<input type="text" name="q" aria-labelledby="searchlabel"
|
||||
placeholder="Search"/>
|
||||
<input type="submit" value="{{ _('Go') }}" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">$('#searchbox').show(0);</script>
|
||||
{%- endif %}
|
|
@ -1,7 +0,0 @@
|
|||
<style>
|
||||
ul {list-style: none;}
|
||||
li {margin: 0.4em 0;}
|
||||
@media (min-width: 46em) {
|
||||
#features {width: 50%;}
|
||||
}
|
||||
</style>
|
|
@ -44,7 +44,7 @@ Partner projects, sign up here! (by 22 March)
|
|||
What does it mean to "adopt pytest"?
|
||||
-----------------------------------------
|
||||
|
||||
There can be many different definitions of "success". Pytest can run many unittest_ tests by default, so using pytest as your testrunner may be possible from day 1. Job done, right?
|
||||
There can be many different definitions of "success". Pytest can run many nose_ and unittest_ tests by default, so using pytest as your testrunner may be possible from day 1. Job done, right?
|
||||
|
||||
Progressive success might look like:
|
||||
|
||||
|
@ -62,6 +62,7 @@ Progressive success might look like:
|
|||
|
||||
It may be after the month is up, the partner project decides that pytest is not right for it. That's okay - hopefully the pytest team will also learn something about its weaknesses or deficiencies.
|
||||
|
||||
.. _nose: nose.html
|
||||
.. _unittest: unittest.html
|
||||
.. _assert: assert.html
|
||||
.. _pycmd: https://bitbucket.org/hpk42/pycmd/overview
|
||||
|
|
|
@ -6,19 +6,6 @@ Release announcements
|
|||
:maxdepth: 2
|
||||
|
||||
|
||||
release-8.2.2
|
||||
release-8.2.1
|
||||
release-8.2.0
|
||||
release-8.1.2
|
||||
release-8.1.1
|
||||
release-8.1.0
|
||||
release-8.0.2
|
||||
release-8.0.1
|
||||
release-8.0.0
|
||||
release-8.0.0rc2
|
||||
release-8.0.0rc1
|
||||
release-7.4.4
|
||||
release-7.4.3
|
||||
release-7.4.2
|
||||
release-7.4.1
|
||||
release-7.4.0
|
||||
|
|
|
@ -62,7 +62,7 @@ New Features
|
|||
- new "-q" option which decreases verbosity and prints a more
|
||||
nose/unittest-style "dot" output.
|
||||
|
||||
- many, many, more detailed improvements details
|
||||
- many many more detailed improvements details
|
||||
|
||||
Fixes
|
||||
-----------------------
|
||||
|
@ -109,7 +109,7 @@ Important Notes
|
|||
in conftest.py files. They will cause nothing special.
|
||||
- removed support for calling the pre-1.0 collection API of "run()" and "join"
|
||||
- removed reading option values from conftest.py files or env variables.
|
||||
This can now be done much, much, better and easier through the ini-file
|
||||
This can now be done much much better and easier through the ini-file
|
||||
mechanism and the "addopts" entry in particular.
|
||||
- removed the "disabled" attribute in test classes. Use the skipping
|
||||
and pytestmark mechanism to skip or xfail a test class.
|
||||
|
|
|
@ -4,7 +4,7 @@ pytest-2.2.2: bug fixes
|
|||
pytest-2.2.2 (updated to 2.2.3 to fix packaging issues) is a minor
|
||||
backward-compatible release of the versatile py.test testing tool. It
|
||||
contains bug fixes and a few refinements particularly to reporting with
|
||||
"--collectonly", see below for details.
|
||||
"--collectonly", see below for betails.
|
||||
|
||||
For general information see here:
|
||||
|
||||
|
|
|
@ -181,7 +181,7 @@ Bug fixes:
|
|||
partially failed (finalizers would not always be called before)
|
||||
|
||||
- fix issue320 - fix class scope for fixtures when mixed with
|
||||
module-level functions. Thanks Anatoly Bubenkoff.
|
||||
module-level functions. Thanks Anatloy Bubenkoff.
|
||||
|
||||
- you can specify "-q" or "-qq" to get different levels of "quieter"
|
||||
reporting (thanks Katarzyna Jachim)
|
||||
|
|
|
@ -83,7 +83,7 @@ holger krekel
|
|||
Thanks Ralph Schmitt for the precise failure example.
|
||||
|
||||
- fix issue244 by implementing special index for parameters to only use
|
||||
indices for parametrized test ids
|
||||
indices for paramentrized test ids
|
||||
|
||||
- fix issue287 by running all finalizers but saving the exception
|
||||
from the first failing finalizer and re-raising it so teardown will
|
||||
|
|
|
@ -73,7 +73,7 @@ holger krekel
|
|||
- cleanup setup.py a bit and specify supported versions. Thanks Jurko
|
||||
Gospodnetic for the PR.
|
||||
|
||||
- change XPASS colour to yellow rather than red when tests are run
|
||||
- change XPASS colour to yellow rather then red when tests are run
|
||||
with -v.
|
||||
|
||||
- fix issue473: work around mock putting an unbound method into a class
|
||||
|
|
|
@ -55,7 +55,7 @@ holger krekel
|
|||
github. See https://pytest.org/en/stable/contributing.html .
|
||||
Thanks to Anatoly for pushing and initial work on this.
|
||||
|
||||
- fix issue650: new option ``--doctest-ignore-import-errors`` which
|
||||
- fix issue650: new option ``--docttest-ignore-import-errors`` which
|
||||
will turn import errors in doctests into skips. Thanks Charles Cloud
|
||||
for the complete PR.
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ The py.test Development Team
|
|||
**New Features**
|
||||
|
||||
* New ``pytest.mark.skip`` mark, which unconditionally skips marked tests.
|
||||
Thanks :user:`MichaelAquilina` for the complete PR (:pr:`1040`).
|
||||
Thanks :user:`MichaelAquilina` for the complete PR (:pull:`1040`).
|
||||
|
||||
* ``--doctest-glob`` may now be passed multiple times in the command-line.
|
||||
Thanks :user:`jab` and :user:`nicoddemus` for the PR.
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue