Skip to content

Commit 65ef53f

Browse files
committed
Merge branch 'main' into faulthandler-exit-on-timeout
2 parents da1adf3 + bf92deb commit 65ef53f

File tree

17 files changed

+134
-47
lines changed

17 files changed

+134
-47
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Doc Check Links
2+
3+
on:
4+
schedule:
5+
# At 00:00 on Sunday.
6+
# https://crontab.guru
7+
- cron: '0 0 * * 0'
8+
workflow_dispatch:
9+
10+
# Set permissions at the job level.
11+
permissions: {}
12+
13+
jobs:
14+
doc-check-links:
15+
if: github.repository_owner == 'pytest-dev'
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v5
21+
with:
22+
fetch-depth: 0
23+
persist-credentials: false
24+
25+
- name: Setup Python
26+
uses: actions/setup-python@v5
27+
with:
28+
python-version: "3.11"
29+
cache: pip
30+
31+
- name: Install dependencies
32+
run: |
33+
python -m pip install --upgrade pip
34+
pip install tox
35+
36+
- name: Run sphinx linkcheck via tox
37+
run: tox -e docs-checklinks

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: "v0.12.10"
3+
rev: "v0.12.11"
44
hooks:
55
- id: ruff
66
args: ["--fix"]

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@ Marcin Augustynów
282282
Marcin Bachry
283283
Marc Bresson
284284
Marco Gorelli
285+
Marcos Boger
285286
Mark Abramowitz
286287
Mark Dickinson
287288
Mark Vong

changelog/12474.contrib.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Added scheduled GitHub Action Workflow to run Sphinx linkchecks in repo documentation.

changelog/13577.doc.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Clarify that ``pytest_generate_tests`` is discovered in test modules/classes; other hooks must be in ``conftest.py`` or plugins.

changelog/13684.contrib.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Make pytest's own testsuite insensitive to the presence of the ``CI`` environment variable -- by :user:`ogrisel`.

doc/en/how-to/parametrize.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,13 @@ command line option and the parametrization of our test function:
240240
if "stringinput" in metafunc.fixturenames:
241241
metafunc.parametrize("stringinput", metafunc.config.getoption("stringinput"))
242242
243+
.. note::
244+
245+
The :hook:`pytest_generate_tests` hook can also be implemented directly in a test
246+
module or inside a test class; unlike other hooks, pytest will discover it there
247+
as well. Other hooks must live in a :ref:`conftest.py <localplugin>` or a plugin.
248+
See :ref:`writinghooks`.
249+
243250
If we now pass two stringinput values, our test will run twice:
244251

245252
.. code-block:: pytest

doc/en/how-to/writing_hook_functions.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,12 @@ Example:
235235
"""
236236
print(config.hook)
237237
238+
.. note::
239+
240+
Unlike other hooks, the :hook:`pytest_generate_tests` hook is also discovered when
241+
defined inside a test module or test class. Other hooks must live in
242+
:ref:`conftest.py plugins <localplugin>` or external plugins.
243+
See :ref:`parametrize-basics` and the :ref:`hook-reference`.
238244

239245
.. _`addoptionhooks`:
240246

doc/en/reference/plugin_list.rst

Lines changed: 57 additions & 41 deletions
Large diffs are not rendered by default.

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,9 @@ markers = [
428428
"slow",
429429
# experimental mark for all tests using pexpect
430430
"uses_pexpect",
431+
# Disables the `remove_ci_env_var` autouse fixture on a given test that
432+
# actually inspects whether the CI environment variable is set.
433+
"keep_ci_var",
431434
]
432435

433436
[tool.towncrier]

0 commit comments

Comments
 (0)