Commit Graph

13250 Commits

Author SHA1 Message Date
Christian Maurer 69ea076d55
Update fixture.rst
Availability was misspelled.  It was `availabiility`
2021-04-28 07:01:45 -05:00
Florian Bruhin 40cb2f5b54
Backport training update (#8557) 2021-04-15 20:02:50 +02:00
Ran Benita 724e22cb00
Merge pull request #8519 from pytest-dev/release-6.2.3
Prepare release 6.2.3
2021-04-04 00:43:05 +03:00
pytest bot 3a2fd96305 Prepare release version 6.2.3 2021-04-03 21:41:18 +00:00
Ran Benita 138b19a930
Merge pull request #8517 from bluetech/backport-mktmp
[6.2.x] Fix minor temporary directory security issue
2021-04-04 00:34:15 +03:00
Ran Benita 822686e880 tmpdir: prevent using a non-private root temp directory
pytest uses a root temp directory named `/tmp/pytest-of-<username>`. The
name is predictable, and the directory might already exists from a
previous run, so that's allowed.

This makes it possible for my_user to pre-create
`/tmp/pytest-of-another_user`, thus giving my_user control of
another_user's tempdir.

Prevent this scenario by adding a couple of safety checks. I believe
they are sufficient.

Testing the first check requires changing the owner, which requires
root permissions, so can't be unit-tested easily, but I checked it
manually.
2021-04-04 00:04:50 +03:00
Ran Benita 9dc54f79b0 tmpdir: fix temporary directories created with world-readable permissions
(Written for a Unix system, but might be applicable to Windows as well).

pytest creates a root temporary directory under /tmp, named
`pytest-of-<username>`, and creates tmp_path's and other under it.
/tmp is shared between all users of the system.

This root temporary directory was created with 0o777&~umask permissions,
which usually becomes 0o755, meaning any user in the system could list
and read the files, which is undesirable.

Use 0o700 permissions instead. Also for subdirectories, because the root
dir is adjustable.
2021-04-04 00:00:42 +03:00
Ran Benita 93dbae24e1 pathlib: inline ensure_reset_dir()
This is only used in TempPathFactory.getbasetemp(). We'll be wanting
further control/care there, so move it into there.
2021-04-03 23:39:37 +03:00
Ran Benita 02fdbe2e76 pathlib: remove useless temporary variable 2021-04-03 23:39:32 +03:00
Bruno Oliveira 12e7db85af
Merge pull request #8285 from nicoddemus/backport-8280
[6.2.x] Doc: Move the module declaration to index.rst
2021-01-27 09:13:27 -03:00
Bruno Oliveira 56e4392444 Merge pull request #8280 from xuhdev/module
Doc: Move the module declaration to index.rst
2021-01-27 09:07:33 -03:00
Bruno Oliveira 8220eca963
Merge pull request #8275 from pytest-dev/release-6.2.2
Prepare release 6.2.2
2021-01-25 11:52:23 -03:00
pytest bot b9c98762f5 Prepare release version 6.2.2 2021-01-25 12:30:53 +00:00
Bruno Oliveira 8003fd23b9
Merge pull request #8259 from nicoddemus/backport-8250
[6.2.x] Fix faulthandler for Twisted Logger when used with "--capture=no"
2021-01-20 10:14:34 -03:00
Bruno Oliveira 8d605b9b26 Merge pull request #8250 from daq-tools/fix-twisted-capture 2021-01-20 09:47:10 -03:00
Bruno Oliveira 14e0c3e105
Merge pull request #8225 from The-Compiler/training-update (#8226)
doc: Add note about training early bird discount
2021-01-05 20:49:50 +01:00
Bruno Oliveira 45facc16c8
Merge pull request #8224 from nicoddemus/backport-8220
[6.2.x] DOC: Mark pytest module
2021-01-05 13:31:19 -03:00
Bruno Oliveira 99fe887d7c Merge pull request #8220 from xuhdev/module-doc
DOC: Mark pytest module
2021-01-05 13:26:19 -03:00
Bruno Oliveira 8dbf9dc1aa
Merge pull request #8167 from nicoddemus/backport-8166
[6.2.x] Add Changelog to setup.cfg (#8166)
2020-12-17 13:59:14 -03:00
Adam Johnson baaee2148d Add Changelog to setup.cfg (#8166)
Co-authored-by: Thomas Grainger <tagrain@gmail.com>
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2020-12-17 13:56:18 -03:00
Bruno Oliveira f7d1ab870f
Merge pull request #8163 from bluetech/backport-8152
[6.2.x] terminal: fix "(<Skipped instance>)" skip reason in test status line
2020-12-17 08:31:53 -03:00
Ran Benita b8201c280e Merge pull request #8152 from bluetech/empty-skip
terminal: fix "(<Skipped instance>)" skip reason in test status line
(cherry picked from commit 02e69e5cdc)
2020-12-17 12:59:01 +02:00
Bruno Oliveira 1f0c50b475
Merge pull request #8160 from nicoddemus/backport-7381
[6.2.x] Clarify fixture execution order and provide visual aids (#7381)
2020-12-16 14:02:02 -03:00
Chris NeJame da82e1853c Clarify fixture execution order and provide visual aids (#7381)
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
Co-authored-by: Ran Benita <ran@unusedvar.com>
2020-12-16 13:54:52 -03:00
Bruno Oliveira a566eb9c70
Merge pull request #8149 from pytest-dev/release-6.2.1
Prepare release 6.2.1
2020-12-15 12:39:06 -03:00
pytest bot d3971c30f4 Prepare release version 6.2.1 2020-12-15 13:06:34 +00:00
Bruno Oliveira 780044b64a
Merge pull request #8147 from nicoddemus/backport-8137
[6.2.x] python_api: handle array-like args in approx() #8137
2020-12-15 09:08:58 -03:00
Jakob van Santen 8354995abc python_api: handle array-like args in approx() (#8137) 2020-12-15 08:50:11 -03:00
Bruno Oliveira 8b8b1214f4
Merge pull request #8135 from nicoddemus/backport-8123
[6.2] Merge pull request #8123 from nicoddemus/import-mismatch-unc
2020-12-13 10:50:49 -03:00
Bruno Oliveira f854cf66f4 Merge pull request #8123 from nicoddemus/import-mismatch-unc
Compare also paths on Windows when considering ImportPathMismatchError
2020-12-13 10:35:59 -03:00
Ran Benita c475106f12
Merge pull request #8130 from pytest-dev/release-6.2.0
Prepare release 6.2.0
2020-12-12 23:21:28 +02:00
pytest bot e7073afe6e Prepare release version 6.2.0 2020-12-12 22:45:09 +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 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