Compare commits

...

7 Commits
6.2.3 ... 6.2.4

Author SHA1 Message Date
pytest bot
017dd1ccd6 Prepare release version 6.2.4 2021-05-04 08:33:43 -07:00
Anthony Sottile
18569f44c1 Merge pull request #8629 from asottile/backport_8540
[6.2.x] Merge pull request #8540 from hauntsaninja/assert310
2021-05-04 08:13:02 -07:00
Bruno Oliveira
d8d6812bdf Merge pull request #8540 from hauntsaninja/assert310
(cherry picked from commit af31c60db1)
2021-05-04 07:52:27 -07:00
Bruno Oliveira
a5061484d4 Merge pull request #8607 from cmaurer/patch-1
Update fixture.rst
2021-04-28 09:54:22 -03:00
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
8 changed files with 56 additions and 9 deletions

View File

@@ -273,6 +273,7 @@ Sankt Petersbug
Segev Finer
Serhii Mozghovyi
Seth Junot
Shantanu Jain
Shubham Adep
Simon Gomizelj
Simon Kerr

View File

@@ -6,6 +6,7 @@ Release announcements
:maxdepth: 2
release-6.2.4
release-6.2.3
release-6.2.2
release-6.2.1

View File

@@ -0,0 +1,22 @@
pytest-6.2.4
=======================================
pytest 6.2.4 has just been released to PyPI.
This is a bug-fix release, being a drop-in replacement. To upgrade::
pip install --upgrade pytest
The full changelog is available at https://docs.pytest.org/en/stable/changelog.html.
Thanks to all of the contributors to this release:
* Anthony Sottile
* Bruno Oliveira
* Christian Maurer
* Florian Bruhin
* Ran Benita
Happy testing,
The pytest Development Team

View File

@@ -28,6 +28,15 @@ with advance notice in the **Deprecations** section of releases.
.. towncrier release notes start
pytest 6.2.4 (2021-05-04)
=========================
Bug Fixes
---------
- `#8539 <https://github.com/pytest-dev/pytest/issues/8539>`_: Fixed assertion rewriting on Python 3.10.
pytest 6.2.3 (2021-04-03)
=========================

View File

@@ -1124,7 +1124,7 @@ never have been made.
.. _`conftest.py`:
.. _`conftest`:
Fixture availabiility
Fixture availability
---------------------
Fixture availability is determined from the perspective of the test. A fixture

View File

@@ -28,7 +28,7 @@ Install ``pytest``
.. code-block:: bash
$ pytest --version
pytest 6.2.3
pytest 6.2.4
.. _`simpletest`:

View File

@@ -2,7 +2,7 @@
.. sidebar:: Next Open Trainings
- `Professional testing with Python <https://www.python-academy.com/courses/specialtopics/python_course_testing.html>`_, via Python Academy, February 1-3 2021, remote and Leipzig (Germany). **Early-bird discount available until January 15th**.
- `Professionelles Testen für Python mit pytest <https://www.enterpy.de/lecture_compact1.php?id=12713>`_ (German), part of the enterPy conference, April 22nd (sold out) and May 20th, remote.
Also see `previous talks and blogposts <talks.html>`_.

View File

@@ -673,12 +673,9 @@ class AssertionRewriter(ast.NodeVisitor):
if not mod.body:
# Nothing to do.
return
# Insert some special imports at the top of the module but after any
# docstrings and __future__ imports.
aliases = [
ast.alias("builtins", "@py_builtins"),
ast.alias("_pytest.assertion.rewrite", "@pytest_ar"),
]
# We'll insert some special imports at the top of the module, but after any
# docstrings and __future__ imports, so first figure out where that is.
doc = getattr(mod, "docstring", None)
expect_docstring = doc is None
if doc is not None and self.is_rewrite_disabled(doc):
@@ -710,10 +707,27 @@ class AssertionRewriter(ast.NodeVisitor):
lineno = item.decorator_list[0].lineno
else:
lineno = item.lineno
# Now actually insert the special imports.
if sys.version_info >= (3, 10):
aliases = [
ast.alias("builtins", "@py_builtins", lineno=lineno, col_offset=0),
ast.alias(
"_pytest.assertion.rewrite",
"@pytest_ar",
lineno=lineno,
col_offset=0,
),
]
else:
aliases = [
ast.alias("builtins", "@py_builtins"),
ast.alias("_pytest.assertion.rewrite", "@pytest_ar"),
]
imports = [
ast.Import([alias], lineno=lineno, col_offset=0) for alias in aliases
]
mod.body[pos:pos] = imports
# Collect asserts.
nodes: List[ast.AST] = [mod]
while nodes: