Commit Graph

13226 Commits

Author SHA1 Message Date
Bruno Oliveira 7e2e6630ad
Merge pull request #8123 from nicoddemus/import-mismatch-unc
Compare also paths on Windows when considering ImportPathMismatchError
2020-12-13 10:35:11 -03:00
Ran Benita fa784e1436
Merge pull request #8104 from bot2x/patch-1
migrates test_warnings.py from testdir to pytester
2020-12-13 15:21:37 +02:00
bot2x 28588bf535 migrates test_warnings.py from testdir to pytester 2020-12-13 14:13:49 +02:00
Ran Benita 37b154b1ec
Merge pull request #8122 from bluetech/py-to-pathlib-3
Some py.path.local -> pathlib.Path
2020-12-13 10:54:19 +02:00
Ran Benita 09582048be
Merge pull request #8131 from bluetech/cherry-pick-release
Merge pull request #8130 from pytest-dev/release-6.2.0
2020-12-12 23:28:31 +02:00
Ran Benita 54a7356a9f Merge pull request #8130 from pytest-dev/release-6.2.0
Prepare release 6.2.0

(cherry picked from commit c475106f12ed87fe908544ff383c5205638c086d)
2020-12-12 23:23:19 +02:00
Ran Benita 683f29f84d
Merge pull request #8129 from bluetech/docs-pygments-workaround
doc: temporary workaround for pytest-pygments lexing error
2020-12-12 22:31:10 +02:00
Ran Benita 0feeddf8ed doc: temporary workaround for pytest-pygments lexing error
pytest-pygments doesn't yet recognize the skip reason in summary line
added recently. Workaround it until we get to updating it.
2020-12-12 22:18:23 +02:00
Ran Benita b478275777
Merge pull request #8128 from bluetech/skip-reason-empty
terminal: when the skip/xfail is empty, don't show it as "()"
2020-12-12 22:18:06 +02:00
Ran Benita 3302ff9949 terminal: when the skip/xfail is empty, don't show it as "()"
Avoid showing a line like

    x.py::test_4 XPASS ()   [100%]

which looks funny.
2020-12-12 22:09:00 +02:00
Ran Benita 59bd0f6912
Merge pull request #8126 from bluetech/tox-regen-pretend-scm2
tox: use pip legacy resolver for regen job
2020-12-12 20:50:10 +02:00
Ran Benita 6298ff1f4e tox: use pip legacy resolver for regen job
The env var effects all of the pip installs, including regendoc which
also uses setuptools-scm, so it gets the wrong version, and fails to
install with the new pip resolver:

    ERROR: Requested regendoc from 206e495142e223858fee890eed0188/regendoc-0.6.1.tar.gz#sha256=db1e8c9ae02c1af559eae105bfd77ba41ed07fc8ca7030ea59db5f3f161236a4 has different version in metadata: '6.2.0'
2020-12-12 20:27:59 +02:00
Ran Benita d51ecbd44d
Merge pull request #8125 from bluetech/tox-rm-pip-req
tox: remove requires: pip>=20.3.1
2020-12-12 19:11:27 +02:00
Ran Benita f237b077fc tox: remove requires: pip>=20.3.1
Causes some trouble in CI and not really needed as old pip should still
work.
2020-12-12 18:31:52 +02:00
Ran Benita 95e0e19b8d
Merge pull request #8124 from bluetech/s0undt3ch-feature/skip-context-hook
Add `pytest_markeval_namespace` hook.
2020-12-12 18:14:02 +02:00
Anton cf1051cfba
infrastructure: Stricter tox dependensies (#8119) 2020-12-12 18:08:15 +02:00
Pedro Algarvio b16c091253 Add `pytest_markeval_namespace` hook.
Add a new hook , `pytest_markeval_namespace` which should return a dictionary.
This dictionary will be used to augment the "global" variables available to evaluate skipif/xfail/xpass markers.

Pseudo example

``conftest.py``:

.. code-block:: python
   def pytest_markeval_namespace():
       return {"color": "red"}
``test_func.py``:

.. code-block:: python
   @pytest.mark.skipif("color == 'blue'", reason="Color is not red")
   def test_func():
       assert False
2020-12-12 17:41:37 +02:00
Ran Benita ed658d6829 Some py.path.local -> pathlib.Path
- Some conftest related functions
- _confcutdir
- Allow arbitrary os.PathLike[str] in gethookproxy.
2020-12-12 17:33:28 +02:00
Bruno Oliveira 572dfcd160 Compare also paths on Windows when considering ImportPathMismatchError
On Windows, os.path.samefile returns false for paths mounted in UNC paths which
point to the same location.

I couldn't reproduce the actual case reported, but looking at the code it seems
this commit should fix the issue.

Fix #7678
Fix #8076
2020-12-12 08:54:49 -03:00
Ran Benita 902739cfc3
Merge pull request #7208 from CarycaKatarzyna/issue2044
Issue 2044 - show skipping reason in verbose mode
2020-12-09 10:11:47 +02:00
Katarzyna 612f157dbd Show reason for skipped test in verbose mode 2020-12-09 09:43:47 +02:00
Anton 810b878ef8
Migrate to pytester: test_capture.py, test_terminal.py, approx.py (#8108)
* Migrate to pytester: test_capture.py, test_config.py, approx.py

* migrate test_terminal.py

* revert test_config.py

* more typing in test_terminal.py

* try-out 'tr' fixture update

* revert 'tr' fixture, update test_config.py
2020-12-08 22:20:02 +02:00
Bruno Oliveira 059f6ff315
Merge pull request #8107 from pytest-dev/dependabot/pip/testing/plugins_integration/pytest-html-3.1.0
build(deps): bump pytest-html from 3.0.0 to 3.1.0 in /testing/plugins_integration
2020-12-07 08:52:56 -03:00
Bruno Oliveira f3006ecb2b
Merge pull request #8106 from pytest-dev/dependabot/pip/testing/plugins_integration/django-3.1.4
build(deps): bump django from 3.1.3 to 3.1.4 in /testing/plugins_integration
2020-12-07 08:52:36 -03:00
dependabot[bot] 19de6bccff
build(deps): bump pytest-html in /testing/plugins_integration
Bumps [pytest-html](https://github.com/pytest-dev/pytest-html) from 3.0.0 to 3.1.0.
- [Release notes](https://github.com/pytest-dev/pytest-html/releases)
- [Changelog](https://github.com/pytest-dev/pytest-html/blob/master/CHANGES.rst)
- [Commits](https://github.com/pytest-dev/pytest-html/compare/v3.0.0...v3.1.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-07 03:08:29 +00:00
dependabot[bot] 8c120c042c
build(deps): bump django in /testing/plugins_integration
Bumps [django](https://github.com/django/django) from 3.1.3 to 3.1.4.
- [Release notes](https://github.com/django/django/releases)
- [Commits](https://github.com/django/django/compare/3.1.3...3.1.4)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-07 03:08:29 +00:00
Bruno Oliveira 68a0f22eee
Merge pull request #8100 from nicoddemus/doctest-alternatives
List pytest-doctestplus in doctest docs
2020-12-05 17:42:09 -03:00
Ran Benita 1a1bb61340
Merge pull request #8038 from matthewhughes934/note-tmpdir-lifetime
Docs: Note lifetime of temporary directories
2020-12-05 21:54:04 +02:00
Ran Benita e398c93884
Merge pull request #8055 from bluetech/unraisable
Add unraisableexception and threadexception plugins
2020-12-05 21:52:17 +02:00
Ran Benita 760a73c08c
Merge pull request #8017 from bluetech/typing-public-fixtures
Export types of builtin fixtures for type annotations
2020-12-05 21:51:20 +02:00
Bruno Oliveira 4fc20c8d28 List pytest-doctestplus in doctest docs
As per https://github.com/pytest-dev/pytest/discussions/8088
2020-12-04 15:24:56 -03:00
Ran Benita 954151cdbd
Merge pull request #8092 from cmecklenborg/pytester_refactor_test_pastebin
Migrate test_pastebin.py from testdir to pytester
2020-12-02 18:17:59 +02:00
Christine Mecklenborg eeb3afb8ab Migrate test_pastebin.py from testdir to pytester 2020-12-01 12:55:59 -06:00
Ran Benita 64bb5f2ad1
Merge pull request #8091 from cmecklenborg/pytester_refactor_test_parseopt
Migrate test_parseopt.py from testdir to pytester
2020-12-01 14:10:09 +02:00
Ran Benita 0d0dfdd7aa
Merge pull request #8090 from cmecklenborg/pytester_refactor_test_nose
Migrate test_nose.py from testdir to pytester
2020-12-01 14:07:55 +02:00
dependabot[bot] 7a06bc2416
build(deps): bump pytest-flakes in /testing/plugins_integration (#8087)
Bumps [pytest-flakes](https://github.com/asmeurer/pytest-flakes) from 4.0.2 to 4.0.3.
- [Release notes](https://github.com/asmeurer/pytest-flakes/releases)
- [Commits](https://github.com/asmeurer/pytest-flakes/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-01 14:06:38 +02:00
Christine Mecklenborg 4abd71121d Migrate test_parseopt.py from testdir to pytester 2020-11-30 16:27:39 -06:00
Christine Mecklenborg d4c81ffab4 Migrate test_nose.py from testdir to pytester 2020-11-30 16:07:26 -06:00
Shubham Adep d1cb9de211
Custom multiple marker execution order (#8065)
* Custom multiple marker execution order

https://github.com/pytest-dev/pytest/issues/8020 issue stated that ordering of multiple custom markers is from inside - out. I have added example for the same in the documentation. Please let me know for further changes / concerns.

* remove trailing spaces

The last commit was failing due to extra spaces

* Ran tox tests locally to debug white space trimming issues

* Resolve: ERROR:   docs: commands failed for tox -e docs

* Update doc/en/reference.rst

Committed PR suggestions.

Co-authored-by: Florian Bruhin <me@the-compiler.org>

* Added reference to Node.iter_markers_with_node in documentation

* Add myself to Authors

Co-authored-by: Shubham <shubham.adep@wsu.edu>
Co-authored-by: Florian Bruhin <me@the-compiler.org>
2020-11-30 16:48:08 +01:00
Matthew Hughes 6a256606c6 Docs: Note lifetime of temporary directories
Explanation: The default handling of these lifetimes is done in
`tmpdir.TempPathFactory.getbasetemp`, which passes `keep=3` to
`pathlib.make_numbered_dir_with_cleanup`.

GH Issue: #8036
2020-11-28 21:18:16 +00:00
Prakhar Gurunani 3405c7e6a8
Add more info about skipping doctests (#8080)
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2020-11-28 12:47:02 -03:00
Dominic Mortlock 775ba63c67
Refactor acceptance_test to use pytester (#8070) 2020-11-25 14:42:47 +02:00
Ran Benita 70823da7ed
Merge pull request #8064 from symonk/fix-typo-in-mock-timing
fix mock_timing fixture name (typo) in timing.py
2020-11-25 12:29:34 +02:00
Jürgen Gmach d27806295a
fix typo (#8069) 2020-11-24 22:27:34 +01:00
Simon K b310872300
fix mock_timing fixture name (typo) in timing.py 2020-11-23 20:45:12 +00:00
Ran Benita d50df85e26 Add unraisableexception and threadexception plugins 2020-11-21 21:11:48 +02:00
Ran Benita d59a4996ae
Merge pull request #8057 from nicoddemus/changelog-links
Add links to some CHANGELOG entries
2020-11-21 20:47:27 +02:00
Maximilian Cosmo Sitter 0cef530d10
Add str() support to LineMatcher (#8050) 2020-11-21 20:45:20 +02:00
Bruno Oliveira 31021ac8d5 Add links to some CHANGELOG entries
While adding links to https://github.com/pytest-dev/pytest/pull/8052, noticed
a few more missing.
2020-11-21 11:05:54 -03:00
Simon K 52fef811c2
permit node to warn with any warning type, not just PytestWarning (#8052)
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2020-11-21 10:49:17 -03:00