Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tests] Implementation of the new testing plugin (backward-compatible) [part 2] #12093

Open
wants to merge 78 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
a4ef0a5
patch marker signatures
picnixz Mar 14, 2024
793f45c
update doc
picnixz Mar 14, 2024
4bc677f
revert suppression
picnixz Mar 14, 2024
c69f375
add xdist dependency but disable it for now
picnixz Mar 14, 2024
02e7813
Merge branch 'master' into fix/testing-types
picnixz Mar 14, 2024
42f6044
fixup
picnixz Mar 14, 2024
e17f0b7
Merge branch 'fix/testing-types' into core/test-plugin
picnixz Mar 14, 2024
b5457e8
implement new plugin
picnixz Mar 14, 2024
550a30f
fixup
picnixz Mar 14, 2024
2235e7f
fixup
picnixz Mar 14, 2024
c8ffbd8
try to fix windows
picnixz Mar 14, 2024
2b372cc
fixup
picnixz Mar 14, 2024
866059e
fixup?
picnixz Mar 14, 2024
9ee89b4
fixup
picnixz Mar 14, 2024
100f861
fix a check + test
picnixz Mar 15, 2024
30b82d7
Merge branch 'master' into fix/testing-types
picnixz Mar 15, 2024
875ef51
fixup
picnixz Mar 15, 2024
bc00228
make the plugin backwards compatible
picnixz Mar 15, 2024
4ce0115
Merge branch 'master' into core/test-plugin
picnixz Mar 15, 2024
504bf49
Merge branch 'master' into fix/testing-types
picnixz Mar 15, 2024
6f21442
ensure type safety
picnixz Mar 15, 2024
6789bc3
allow buildername as a keyword argument in the marker
picnixz Mar 15, 2024
333aa8f
allow buildername as a keyword argument in the marker
picnixz Mar 15, 2024
91b035f
allow buildername as a keyword argument in the marker
picnixz Mar 15, 2024
1aaa037
fix deprecation warning
picnixz Mar 15, 2024
42e27f0
revert some changes
picnixz Mar 15, 2024
beb9c1e
revert some changes
picnixz Mar 15, 2024
4d7172a
cleanup and simplify
picnixz Mar 15, 2024
33d5772
cleanup and simplify
picnixz Mar 15, 2024
5be3c74
remove xdist for now
picnixz Mar 15, 2024
b4f43ee
cleanup
picnixz Mar 15, 2024
fe89013
Merge branch 'master' into fix/testing-types
picnixz Mar 15, 2024
a93efe4
revert some changes
picnixz Mar 15, 2024
6c45a41
remove ref
picnixz Mar 15, 2024
f60e97e
revert order
picnixz Mar 15, 2024
ba61814
Merge branch 'fix/testing-types' into core/test-plugin
picnixz Mar 15, 2024
cd94c8f
Merge branch 'master' into core/test-plugin
picnixz Mar 16, 2024
54e394f
Merge branch 'master' into core/test-plugin
picnixz Mar 16, 2024
dce556d
fixup
picnixz Mar 16, 2024
a880fd0
use private naming
picnixz Mar 16, 2024
b5faf40
Merge branch 'master' into core/test-plugin
picnixz Mar 16, 2024
6b43a6a
Refine configuration checksum
picnixz Mar 16, 2024
f7d7b73
Refine configuration checksum
picnixz Mar 16, 2024
d312815
fixup
picnixz Mar 16, 2024
318e075
Merge branch 'master' into core/test-plugin
picnixz Mar 17, 2024
4e06556
fixup
picnixz Mar 17, 2024
33d48f7
Merge branch 'master' into core/test-plugin
picnixz Mar 17, 2024
0da65df
update comment
picnixz Mar 18, 2024
f2e1044
Merge branch 'master' into core/test-plugin
picnixz Mar 23, 2024
31e61b5
fixup isolation deduction
picnixz Mar 23, 2024
86de828
fixup isolation deduction
picnixz Mar 23, 2024
329b98b
cleanup
picnixz Mar 23, 2024
2a5d03a
apply ruff format
picnixz Mar 23, 2024
455b97d
Merge branch 'master' into core/test-plugin
picnixz Mar 23, 2024
e33ba40
fixup
picnixz Mar 23, 2024
847eb7a
Merge branch 'master' into core/test-plugin
picnixz Mar 24, 2024
f787670
Merge branch 'master' into core/test-plugin
picnixz Mar 24, 2024
a257ec2
Merge branch 'master' into core/test-plugin
picnixz Mar 27, 2024
a7e4026
fix lint
picnixz Mar 27, 2024
da6e9c5
Merge branch 'master' into core/test-plugin
picnixz Apr 2, 2024
054cb79
fix lint
picnixz Apr 2, 2024
e859d9f
Merge branch 'master' into core/test-plugin
picnixz Apr 6, 2024
f68197b
fixup
picnixz Apr 6, 2024
d71fdf5
Merge remote-tracking branch 'upstream/master' into core/test-plugin
picnixz Apr 19, 2024
e431ce9
cleanup
picnixz Apr 19, 2024
74d96a3
cleanup
picnixz Apr 19, 2024
9560a65
cleanup
picnixz Apr 19, 2024
a452a03
Merge branch 'master' into core/test-plugin
picnixz Apr 27, 2024
9ca2a3b
Merge branch 'master' into core/test-plugin
picnixz May 1, 2024
4f86bc8
Merge branch 'master' into core/test-plugin
picnixz May 21, 2024
32fd55e
Merge remote-tracking branch 'upstream/master' into core/test-plugin
picnixz Jul 20, 2024
588871e
update conftests
picnixz Jul 20, 2024
4ec3e12
update conftests
picnixz Jul 20, 2024
acfcf5f
lint
picnixz Jul 20, 2024
53585ab
Merge branch 'master' into core/test-plugin
picnixz Sep 29, 2024
917307a
revert some changes
picnixz Sep 29, 2024
c997def
fix tests
picnixz Sep 29, 2024
f8f760f
fix lint
picnixz Sep 29, 2024
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
18 changes: 18 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ Deprecated
* #11693: Support for old-style :file:`Makefile` and :file:`make.bat` output
in :program:`sphinx-quickstart`, and the associated options :option:`!-M`,
:option:`!-m`, :option:`!--no-use-make-mode`, and :option:`!--use-make-mode`.
* #11285: Direct access to :attr:`!sphinx.testing.util.SphinxTestApp._status`
or :attr:`!sphinx.testing.util.SphinxTestApp._warning` is deprecated. Use
the public properties :attr:`!sphinx.testing.util.SphinxTestApp.status`
and :attr:`!sphinx.testing.util.SphinxTestApp.warning` instead.
Patch by Bénédikt Tran.

Features added
--------------
Expand Down Expand Up @@ -99,6 +104,19 @@ Bugs fixed

Testing
-------
* #11285: :func:`!pytest.mark.sphinx` requires keyword arguments, except for
the builder name which can still be given as the first positional argument.
Patch by Bénédikt Tran.
* #11285: :func:`!pytest.mark.sphinx` accepts *warningiserror*, *keep_going*
and *verbosity* as additional keyword arguments.
Patch by Bénédikt Tran.
* #11285: :class:`!sphinx.testing.util.SphinxTestApp` *srcdir* argument is
now mandatory (previously, this was checked with an assertion).
Patch by Bénédikt Tran.
* #11285: :class:`!sphinx.testing.util.SphinxTestApp` *status* and *warning*
arguments are checked to be :class:`io.StringIO` objects (the public API
incorrectly assumed this without checking it).
Patch by Bénédikt Tran.

Release 7.2.6 (released Sep 13, 2023)
=====================================
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ lint = [
]
test = [
"pytest>=6.0",
"pytest-xdist==3.5.0",
"html5lib",
"cython>=3.0",
"setuptools>=67.0", # for Cython compilation
Expand Down Expand Up @@ -216,6 +217,7 @@ disallow_any_generics = false
minversion = 6.0
addopts = [
"-ra",
"-p no:xdist", # disable xdist for now
"--import-mode=prepend",
# "--pythonwarnings=error",
"--strict-config",
Expand Down
30 changes: 30 additions & 0 deletions sphinx/testing/_xdist_hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""Hooks to register when the ``xdist`` plugin is active.

Wen ``xdist`` is active, the controller node automatically loads
this module through :func:`sphinx.testing.plugin.pytest_addhooks`.
"""

from __future__ import annotations

__all__ = ()

from typing import TYPE_CHECKING

if TYPE_CHECKING:
import pytest
from xdist.workermanage import NodeManager, WorkerController


def pytest_configure_node(node: WorkerController) -> None:
node_config: pytest.Config = node.config
# the node's config is not the same as the controller's config
assert node_config.pluginmanager.has_plugin('xdist'), 'xdist is not loaded'

manager: NodeManager = node.nodemanager
config: pytest.Config = manager.config
assert config.pluginmanager.has_plugin('xdist'), 'xdist is not loaded'

# worker nodes do not inherit the 'config.option.dist' value
# when used by pytester, so we simply copy it from the main
# controller to the worker node
node.workerinput['sphinx_xdist_policy'] = config.option.dist
Loading
Loading