Skip to content
Myr

Randomize tests and run them in parallel

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Document optional test suites

authored by Kevin Deldycke · committed by Kevin Deldycke · parent ac2dd7a · Browse files · 5 files+84 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

5 files+84 added−2 removed

  • other:+84 added−2 removed

5 files+84 added−2 removed

added:docs/contributing.md+21 added
modified:docs/index.rst+1 added-2 removed
131 unmodified lines
132* This documentation is structured according to `Diataxis <https://diataxis.fr/>`_ and written with `MyST <https://myst-parser.readthedocs.io/en/latest/>`_133134* `Version Policy <https://palletsprojects.com/versions>`_135136* `Contributing <https://palletsprojects.com/contributing/>`_137136* `Donate <https://palletsprojects.com/donate>`_137138.. toctree::139 :maxdepth: 1140141 contributing142 contrib143 license144 changes
modified:CHANGES.rst+4 added
15 unmodified lines
16- Patch ``pdb.Pdb`` in ``CliRunner`` isolation so ``pdb.set_trace()``,17 ``breakpoint()``, and debuggers subclassing ``pdb.Pdb`` (ipdb, pdbpp) can18 interact with the real terminal instead of the captured I/O streams.19 :issue:`654` :issue:`824` :issue:`843` :pr:`951` :pr:`3235`20- Add optional randomized parallel test execution using ``pytest-randomly`` and21 ``pytest-xdist`` to detect test pollution and race conditions. :pr:`3151`22- Add contributor documentation for running stress tests, randomized23 parallel tests, and Flask smoke tests. :pr:`3151` :pr:`3177`2425Version 8.3.226-------------27
1323 unmodified lines
modified:pyproject.toml+14 added
49 unmodified lines
50]51tests = [52 "pytest",53]54tests-random = [55 "pytest",56 "pytest-randomly",57 "pytest-xdist",58]59typing = [60 "mypy",61 "pyright",62 "pytest",
106 unmodified lines
169 "pytest", "-v", "--tb=short", "--basetemp={env_tmp_dir}",170 {replace = "posargs", default = [], extend = true},171]]172173[tool.tox.env.random]174description = "randomized parallel tests to detect test pollution and race conditions"175dependency_groups = ["tests-random"]176commands = [[177 "pytest", "-v", "--tb=short", "--numprocesses=auto",178 "--basetemp={env_tmp_dir}",179 {replace = "posargs", default = [], extend = true},180]]181182[tool.tox.env.stress]183description = "stress tests for stream lifecycle race conditions"184commands = [[185 "pytest", "-v", "--tb=short", "-x", "-m", "stress",
51 unmodified lines
modified:uv.lock+44 added
207 unmodified lines
208]209tests = [210 { name = "pytest" },211]212tests-random = [213 { name = "pytest" },214 { name = "pytest-randomly" },215 { name = "pytest-xdist" },216]217typing = [218 { name = "mypy" },219 { name = "pyright" },220 { name = "pytest" },
21 unmodified lines
242 { name = "pre-commit" },243 { name = "pre-commit-uv" },244]245tests = [{ name = "pytest" }]246tests-random = [247 { name = "pytest" },248 { name = "pytest-randomly" },249 { name = "pytest-xdist" },250]251typing = [252 { name = "mypy" },253 { name = "pyright" },254 { name = "pytest" },
54 unmodified lines
309 { url = "https://files.pythonhosted.org/packages/8a/0e/97c33bf5009bdbac74fd2beace167cab3f978feb69cc36f1ef79360d6c4e/exceptiongroup-1.3.1-py3-none-any.whl", hash = "sha256:a7a39a3bd276781e98394987d3a5701d0c4edffb633bb7a5144577f82c773598", size = 16740, upload-time = "2025-11-21T23:01:53.443Z" },310]311312[[package]]313name = "execnet"314version = "2.1.2"315source = { registry = "https://pypi.org/simple" }316sdist = { url = "https://files.pythonhosted.org/packages/bf/89/780e11f9588d9e7128a3f87788354c7946a9cbb1401ad38a48c4db9a4f07/execnet-2.1.2.tar.gz", hash = "sha256:63d83bfdd9a23e35b9c6a3261412324f964c2ec8dcd8d3c6916ee9373e0befcd", size = 166622, upload-time = "2025-11-12T09:56:37.75Z" }317wheels = [318 { url = "https://files.pythonhosted.org/packages/ab/84/02fc1827e8cdded4aa65baef11296a9bbe595c474f0d6d758af082d849fd/execnet-2.1.2-py3-none-any.whl", hash = "sha256:67fba928dd5a544b783f6056f449e5e3931a5c378b128bc18501f7ea79e296ec", size = 40708, upload-time = "2025-11-12T09:56:36.333Z" },319]320321[[package]]322name = "filelock"323version = "3.25.2"324source = { registry = "https://pypi.org/simple" }325sdist = { url = "https://files.pythonhosted.org/packages/94/b8/00651a0f559862f3bb7d6f7477b192afe3f583cc5e26403b44e59a55ab34/filelock-3.25.2.tar.gz", hash = "sha256:b64ece2b38f4ca29dd3e810287aa8c48182bbecd1ae6e9ae126c9b35f1382694", size = 40480, upload-time = "2026-03-11T20:45:38.487Z" }
587 unmodified lines
913 { url = "https://files.pythonhosted.org/packages/67/0f/019d3949a40280f6193b62bc010177d4ce702d0fce424322286488569cd3/python_discovery-1.2.1-py3-none-any.whl", hash = "sha256:b6a957b24c1cd79252484d3566d1b49527581d46e789aaf43181005e56201502", size = 31674, upload-time = "2026-03-26T22:30:43.396Z" },914]915916[[package]]917name = "pytest-randomly"918version = "4.0.1"919source = { registry = "https://pypi.org/simple" }920dependencies = [921 { name = "pytest" },922]923sdist = { url = "https://files.pythonhosted.org/packages/c4/1d/258a4bf1109258c00c35043f40433be5c16647387b6e7cd5582d638c116b/pytest_randomly-4.0.1.tar.gz", hash = "sha256:174e57bb12ac2c26f3578188490bd333f0e80620c3f47340158a86eca0593cd8", size = 14130, upload-time = "2025-09-12T15:23:00.085Z" }924wheels = [925 { url = "https://files.pythonhosted.org/packages/33/3e/a4a9227807b56869790aad3e24472a554b585974fe7e551ea350f50897ae/pytest_randomly-4.0.1-py3-none-any.whl", hash = "sha256:e0dfad2fd4f35e07beff1e47c17fbafcf98f9bf4531fd369d9260e2f858bfcb7", size = 8304, upload-time = "2025-09-12T15:22:58.946Z" },926]927928[[package]]929name = "pytest-xdist"930version = "3.8.0"931source = { registry = "https://pypi.org/simple" }932dependencies = [933 { name = "execnet" },934 { name = "pytest" },935]936sdist = { url = "https://files.pythonhosted.org/packages/78/b4/439b179d1ff526791eb921115fca8e44e596a13efeda518b9d845a619450/pytest_xdist-3.8.0.tar.gz", hash = "sha256:7e578125ec9bc6050861aa93f2d59f1d8d085595d6551c2c90b6f4fad8d3a9f1", size = 88069, upload-time = "2025-07-01T13:30:59.346Z" }937wheels = [938 { url = "https://files.pythonhosted.org/packages/ca/31/d4e37e9e550c2b92a9cbc2e4d0b7420a27224968580b5a447f420847c975/pytest_xdist-3.8.0-py3-none-any.whl", hash = "sha256:202ca578cfeb7370784a8c33d6d05bc6e13b4f25b5053c30a152269fd10f0b88", size = 46396, upload-time = "2025-07-01T13:30:56.632Z" },939]940941[[package]]942name = "pyyaml"943version = "6.0.3"944source = { registry = "https://pypi.org/simple" }945sdist = { url = "https://files.pythonhosted.org/packages/05/8e/961c0007c59b8dd7729d542c61a4d537767a59645b82a0b521206e1e25c2/pyyaml-6.0.3.tar.gz", hash = "sha256:d76623373421df22fb4cf8817020cbb7ef15c725b9d5e45f17e189bfc384190f", size = 130960, upload-time = "2025-09-25T21:33:16.546Z" }
720 unmodified lines