Mahesh Vashishtha
af99040123
Add a note about -W vs filterwarnings. ( #10713 )
...
Closes #10687
Signed-off-by: mvashishtha <mahesh@ponder.io>
2023-02-07 19:27:34 -03:00
vin01
86a1beba07
Clarify docs for `match` regarding escaping ( #10695 )
...
Add example using `re.escape` to escape arbitrary literal strings which might contain regular expression characters like `.` or `)`.
Closes #10595
2023-01-27 08:11:00 -03:00
Yusuke Kadowaki
10220d3f31
Change the default policy to all
2022-12-25 00:18:38 +09:00
Yusuke Kadowaki
62e75c7d55
Documentation update for tmp_path configurations
2022-12-01 22:29:46 +09:00
Ronny Pfannschmidt
5a040aef97
Merge pull request #10412 from pytest-dev/release-7.2.0 ( #10419 )
...
Prepare release 7.2.0
(cherry picked from commit ac4e3cced9fb1df60df271cce308f07713764857)
2022-10-25 13:12:55 +02:00
Itxaso Aizpurua
9e1804a6ee
Add --log-disable CLI option ( #10371 )
...
Fixes #7431
2022-10-23 18:23:34 -03:00
Tony Narlock
7fada7127e
docs(output): Note --no-show-locals
2022-10-14 16:38:14 -05:00
Thomas Grainger
2fd160110c
Merge branch 'main' into warn-when-a-mark-is-applied-to-a-fixture
2022-10-10 13:55:24 +01:00
Vivaan Verma
196f01965e
Replace entrypoint example with `pyproject.toml` in docs ( #10359 )
...
Fixes #10344
2022-10-09 17:42:42 -03:00
Simon K
3bf2bc55b1
Add deprecations for tests written for `nose` ( #9907 )
...
Fixes #9886
2022-10-09 17:16:33 -03:00
Thomas Grainger
faac197fcf
Merge branch 'main' into warn-when-a-mark-is-applied-to-a-fixture
2022-10-09 20:10:53 +01:00
Samuel Gaist
a28d595b46
doc: add note to help modernize code bases to use pathlib
...
Fixes #10199
2022-10-08 10:18:08 +02:00
Bruno Oliveira
0c21d60349
Improve documentation for setup() and teardown() nose support
...
Fix #9549
2022-10-07 11:10:28 -03:00
skhomuti
c326bd5669
Add allure-pytest to the popular plugins list
2022-09-08 22:12:44 +05:00
Bruno Oliveira
7f4b63b143
Merge pull request #10259 from pytest-dev/release-7.1.3
...
Prepare release 7.1.3
(cherry picked from commit 3739e6cd4830cf707dff3fb5c5b93d7a2cec3663)
2022-09-02 08:24:18 -03:00
Philipp A
245a8c23dd
Revamp good practices ( #10206 )
...
* Recommend importlib import mode for new projects
* Recommend src layout more strongly
* Switch to hatchling as the packaging tool in the example (following PyPA)
* Add explanation about the different import modes
2022-09-01 07:55:41 -03:00
Bruno Oliveira
1caa099e42
Fix regendoc
...
The finalizers example was wiping out code needed for the examples below.
2022-08-31 14:28:33 -03:00
Tatiana Ovary
3039391b83
Update documentation on how pytest.warns affects DeprecationWarning #9291 ( #10141 )
...
Co-authored-by: Dani Sancas <lord.sancas@gmail.com>
On-behalf-of: @clarityai-eng <tech@clarity.ai>
Signed-off-by: Tatiana Ovary <tatiana.ovary@clarity.ai>
2022-08-17 11:44:58 -03:00
aizpurua23a
7378f35b03
Update fixtures.rst w/ finalizer order
...
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2022-08-15 14:00:03 -03:00
Bruno Oliveira
2e7c718373
Add reference to the Where to patch docs in monkeypatch.setattr ( #10217 )
...
This should help users with the common issue of patching the wrong place.
Also took the opportunity of using proper links in the monkeypatch introduction.
Related to #10216
Co-authored-by: Ran Benita <ran@unusedvar.com>
2022-08-15 13:55:19 -03:00
Stephen Rosen
b8e2f42ec1
Add monkeypatch.context() to how-to doc intro
2022-07-15 19:26:36 +00:00
Wolfremium
70cac3d464
Explicit note that tmpdir fixture is discouraged in favour of tmp_path #9937 ( #10138 )
...
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
Co-authored-by: kevin.hierro-ext <kevin.hierro-ext@clarity.ai>
Co-authored-by: Dani Sancas <lord.sancas@gmail.com>
2022-07-15 08:40:18 -03:00
Zac Hatfield-Dodds
d2a206683c
Merge pull request #10073 from Kache/main
...
Clarify writing_plugins naming instructions
2022-06-24 23:27:58 -07:00
Kevin C
0a7b8722e5
Clarify writing_plugins naming instructions
...
Fixes : #10072
2022-06-23 18:03:18 -07:00
Chanvin Xiao
1e6a587363
Doc: Clear mailbox before deleting the user
2022-06-22 20:06:37 +08:00
Tony Narlock
c2f684fcd6
docs(monkeypatch): Fix autodoc reference links ( #10013 )
...
Close #10014
2022-06-02 10:16:59 -03:00
Ruth Comer
c5432a18e7
doc: link to pytest-subtests
2022-05-12 12:20:00 +01:00
Pax
a88c0f3bb0
Add link to python docs on logging levels ( #9925 )
2022-05-11 11:02:36 +03:00
MatthewFlamm
5f9d68c8d9
Clarify precision when using NUMBER option in --doctest-modules ( #9914 )
...
Fix #9892
2022-05-06 20:25:44 -03:00
Florian Bruhin
e580534df0
doc: Reformat/Modernize some code ( #9900 )
...
Found because I was curious what https://pypi.org/project/shed/ does with pytest.
2022-04-28 16:30:16 +02:00
Zac Hatfield-Dodds
0347957aa7
Fix wrong `log_file` docs ( #9878 )
...
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2022-04-22 15:15:27 -03:00
Ran Benita
d87e1e67dd
Merge pull request #9758 from pytest-dev/release-7.1.0
...
Prepare release 7.1.0
(cherry picked from commit 7d4d1ecde6cdc3feae9ee076ee5aab4e05393fa6)
2022-03-13 16:59:20 +02:00
Masaru Tsuchiyama
7f50c521b6
fix link of argcomplete page.
2022-02-20 17:29:12 +09:00
Bruno Oliveira
9af3e23695
Expand warnings output for ResourceWarning ( #9682 )
...
Fix #9644
2022-02-15 13:00:50 +00:00
Ran Benita
04a6f52d67
Merge pull request #9611 from pllim/patch-1
...
DOC: pytest.warns() fails on zero warning
2022-02-08 16:00:06 +02:00
Ran Benita
1612d3d1af
doc: remove django intersphinx mapping
...
Initially I just wanted to fix http -> https, but I think it's not worth
having at all just for this one reference.
2022-02-08 00:46:20 +02:00
P. L. Lim
d1b394af88
DOC: pytest.warns() fails on zero warning
2022-02-04 17:45:04 -05:00
Gabor Szabo
57f8f5d2b3
Mention basetemp in docs as a way to only keep last temp dir ( #9607 )
...
Closes #9599
2022-02-04 12:38:26 +00:00
Florian Bruhin
843f03e3ca
doc: Add ellipsis to warning usecase list ( #9558 )
...
I feel like this makes it clearer where the code which was inside 'pytest.warns' is supposed to go.
2022-01-27 13:32:37 +01:00
Olga Matoula
2ad1b589af
Add docs on pytest.warns(None) deprecation ( #9495 )
...
* Add docs on pytest.warns(None) deprecation
* Add new section for common warnings use cases
* Fix references for warnings use cases
* Fix reference link
2022-01-13 18:32:22 +00:00
Dan Alvizu
71baf24b6d
Doc update: clarify -W syntax ( #9464 )
...
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2022-01-04 13:55:01 +00:00
Ran Benita
b9663fed6f
Merge pull request #9442 from hramezani/drop_python_36
...
Drop Python3.6 in CI, setup.cfg, and readme.
2021-12-30 12:22:13 +02:00
Hasan Ramezani
3d7cd77017
Update syntax to Python3.7+.
2021-12-28 10:11:35 +01:00
Kian Meng, Ang
55debfad1f
Fix typos ( #9424 )
2021-12-27 09:23:15 -03:00
Ran Benita
8071ad6b90
doc: fix a reference in "Writing hook functions"
2021-12-25 10:30:59 +02:00
Ran Benita
0b0e2d2dbb
Remove deprecated `_fillfuncargs` function
2021-12-07 22:27:35 +02:00
Florian Bruhin
0ad452bcba
Prepare release version 7.0.0rc1 ( #9375 ) ( #9377 )
...
Co-authored-by: pytest bot <pytestbot@gmail.com>
(cherry picked from commit 85897eddc6d31c5825f5ca28f85e69b8d1506fc4)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2021-12-07 10:13:36 +01:00
Oleg Höfling
49f934618c
Replace hardcoded links to Github issues with extlinks ( #9234 )
2021-11-06 11:16:11 +02:00
Ran Benita
99363ad7ff
recwarn: fix was -> were in DID NOT WARN message
2021-10-27 08:36:10 +03:00
Oleg Höfling
1e9e16d829
Replace hardcoded links to PyPI with extlinks ( #9224 )
2021-10-22 09:47:57 -03:00
Zac Hatfield-Dodds
e763fde482
Merge pull request #9158 from hoefling/doc/internal-crossrefs
...
replace hardcoded urls to docs.pytest.org with internal crossrefs, add crossrefs to numpy docs, use sphinx pep role
2021-10-05 08:43:19 +11:00
Ronny Pfannschmidt
c21ef7ba22
fix #8818 - run regendoc without tox cachedir
...
#4270 introduced per tox env pytest cachedirs and
never protected regendoc against it
2021-10-04 08:56:26 +02:00
oleg.hoefling
d58ee2b677
replace hardcoded urls to docs.pytest.org with internal crossrefs, add external crossrefs where possible
...
Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
2021-10-04 00:23:41 +02:00
Ran Benita
4b13b5993e
Fix syntax typo in writing_hook_functions.rst
2021-10-01 10:26:56 +03:00
ziebam
520aa61e19
Improve docs for pytester.copy_example
2021-09-22 00:16:52 +02:00
Zac Hatfield-Dodds
8900e3b937
Merge pull request #9041 from hoefling/doc/stdlib-crossrefs
2021-09-07 21:22:24 +10:00
Simon K
740abd9684
#9062 - Allow `--stepwise-skip` to implicitly enable `--stepwise` ( #9064 )
...
* #9062 - Allow `--stepwise-skip` to implicitly enable `--stepwise`
* Update changelog/9062.improvement.rst
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2021-08-30 19:24:14 +01:00
Bruno Oliveira
ea5ff44ef3
Merge pull request #9057 from pytest-dev/release-6.2.5
...
(cherry picked from commit 16664a1b72c668161553b64e741492206af441bc)
2021-08-30 14:44:49 -03:00
oleg.hoefling
d1aea7d7a8
use intersphinx crossrefs to stdlib docs where possible instead of hardcoded URLs
...
Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
2021-08-26 16:05:03 +02:00
Hugo van Kemenade
5ec89fd6e5
Docs: refer to non-deprecated unittest alias
2021-08-18 12:43:59 +03:00
Terje Runde
2439729413
logging: Make it possible to add cli colors to custom log levels
...
Closes #8803
PR #8804
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
Co-authored-by: Terje Runde <terje.runde@flir.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-08-09 13:48:47 +00:00
Emmanuel Arias
2834b39b65
Add examples of parametrizing classes and all tests in a module
...
Closes #8947
PR #8962
2021-07-31 13:26:25 +00:00
Ran Benita
6247a95601
Merge pull request #8920 from bluetech/stabilize-store
...
Rename Store to Stash and make it public
2021-07-31 10:32:30 +03:00
symonk
a9a934e8ce
fix minor typo in writing hook functions documentation
2021-07-31 01:49:53 +01:00
Ran Benita
c6bdeb8491
stash: make Stash and StashKey public
...
It's had enough time to bake - let's allow external plugins to use it.
2021-07-24 17:40:08 +03:00
Thomas Grainger
388691a205
rename tmpdir.rst to tmp_path.rst ( #8905 )
2021-07-14 12:53:27 -03:00
Bruno Oliveira
828fde1156
Merge pull request #8858 from The-Compiler/update-doc-urls
2021-07-14 09:28:46 -03:00
Adam J. Stewart
17f1a0af8e
Fix in more places, use default
2021-07-08 12:43:10 -05:00
Sören Wegener
6740fb9da6
doc: Typofix in fixtures how-to ( #8860 )
2021-07-06 14:31:21 +00:00
Florian Bruhin
953fdabaf0
Adjust doc links for new scheme
...
Closes #8831
2021-07-06 09:11:35 +02:00
Srip
9cdb7223b5
doc: Adding the missing sys import ( #8819 ) ( #8827 )
...
Co-authored-by: Sripradha Karkala <sripradha.karkala@nutanix.com>
2021-06-30 08:11:20 +02:00
Florian Bruhin
ba1ad7d517
Opt-out from regendoc for problematic example ( #8810 )
...
* Opt-out from regendoc for problematic example
See #8807
* Add comment
2021-06-28 17:47:49 +00:00
Srip
6573107b97
doc: Adding exit code for pytest usage examples ( #8790 ) ( #8800 )
...
* doc: Adding exit code for pytest usage examples (#8790 )
Fix #8790
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
Co-authored-by: Sripradha Karkala <sripradha.karkala@nutanix.com>
2021-06-27 13:29:16 +00:00
James Bourbeau
942789bace
Fix API links in 'How to capture warnings' documentation page ( #8792 )
2021-06-23 19:34:48 +00:00
Bruno Oliveira
c85b21eaa0
Remove outdated docs about pytest.warns and DeprecatedWarning
...
Since #2908 , the user doesn't need to set warning filters to capture
`DeprecationWarning` with `pytest.warns`.
Fix #8666
2021-06-12 12:09:26 -03:00
Ran Benita
9719237fe6
doc: refer to type by its public name
2021-05-24 12:31:28 +03:00
Olga Matoula
8b2f83772d
Catch any warning on warns with no arg passed
2021-05-15 18:50:39 +01:00
Nico Schlömer
9ef608ef76
"fix" a couple of http -> https redirects
...
Found with
urli-fix . -a http: -i pytest
2021-04-26 17:44:27 +02:00
Stefaan Lippens
7e82f6fc38
Logging docs: fix reference to pytest.LogCaptureFixture.
2021-04-20 15:21:30 +02:00
Daniele Procida
70daa279a7
Further rationalised "how to invoke pytest" material. ( #8536 )
...
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-04-08 21:19:30 -03:00
Bruno Oliveira
be8d63e33b
Increase truncation threshold with -v, disable with -vv
...
Fix #6682
Fix #8403
2021-03-26 07:05:30 -03:00
Daniele Procida
a7d528e058
Restructured 'How to invoke pytest' guide
2021-03-22 22:47:13 +00:00
Thomas Grainger
3f71680ac0
Warn when a mark is applied to a fixture
...
Fixes #3664
2021-03-19 09:30:52 +00:00
Daniele Procida
6ab461f460
Explicitly listed the four documentation sections on index.rst
2021-03-16 20:26:05 +00:00
Daniele Procida
2641761c1c
Merge pull request #8441 from evildmp/evolutionary-documentation-restructure
...
Moved more sections from reference to how-to.
2021-03-15 10:22:11 +02:00
Ran Benita
ba7bd3d77c
doc/tmpdir: significantly reduce space dedicated to tmpdir/tmpdir_factory
...
Emphasize tmp_path/tmp_path_factory and just note the legacy ones.
2021-03-13 20:44:23 +02:00
Ran Benita
db539ed2b0
Merge pull request #8437 from bluetech/rm-typevar-prefix
...
Remove `_` prefix from TypeVars, expose ExceptionInfo
2021-03-13 19:01:29 +02:00
Ran Benita
f2d65c85f4
code: export ExceptionInfo for typing purposes
...
This type is most prominent in `pytest.raises` and we should allow to
refer to it by a public name.
The type is not in a perfectly "exposable" state. In particular:
- The `traceback` property with type `Traceback` which is derived from
the `py.code` API and exposes a bunch more types transitively. This
stuff is *not* exported and probably won't be.
- The `getrepr` method which probably should be private.
But they're already used in the wild so no point in just hiding them
now.
The __init__ API is hidden -- the public API for this are the `from_*`
classmethods.
2021-03-13 15:59:44 +02:00
Daniele Procida
8410d9ac54
Created a new Explanation section and new landing pages for main sections.
...
Added landing pages for:
How-to guides
Reference guides
Explanation
Added links to the main landing pages to the sidebar.
2021-03-12 22:57:53 +00:00
Daniele Procida
ff2ee96b8c
Split fixtures documentation into separate documents.
...
Sections have been moved to:
* reference/fixtures.rst
* how-to/fixtures.rst
* fixtures.rst
according to their function. Further refinement and rewriting will be required.
Some material has been moved to a new "Anatomy of a test" document, in
anticipation that material from other sections will also find a natural
home there later.
Removed several unneeded reference targets from fixtures documentation.
2021-03-12 22:16:47 +00:00
Daniele Procida
d8695410a4
Added how-to and reference directories.
...
Moved various documents into subdirectories, how-to and
reference.
Updated multiple links to use `:ref:` instead of `:doc:`,
meaning that files can henceforth be moved around without
breaking references.
2021-03-11 22:13:01 +00:00