Skip to content

Commit 82eb86f

Browse files
authoredSep 2, 2023
Merge pull request pytest-dev#11377 from pytest-dev/release-7.4.1
Prepare release 7.4.1

14 files changed

+108
-55
lines changed
 

‎.github/workflows/deploy.yml

+24-10
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,59 @@
11
name: deploy
22

33
on:
4-
push:
5-
tags:
6-
# These tags are protected, see:
7-
# https://github.com/pytest-dev/pytest/settings/tag_protection
8-
- "[0-9]+.[0-9]+.[0-9]+"
9-
- "[0-9]+.[0-9]+.[0-9]+rc[0-9]+"
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Release version'
8+
required: true
9+
default: '1.2.3'
1010

1111

1212
# Set permissions at the job level.
1313
permissions: {}
1414

1515
jobs:
16-
build:
16+
package:
1717
runs-on: ubuntu-latest
18+
env:
19+
SETUPTOOLS_SCM_PRETEND_VERSION: ${{ github.event.inputs.version }}
1820
timeout-minutes: 10
21+
1922
steps:
2023
- uses: actions/checkout@v3
2124
with:
2225
fetch-depth: 0
2326
persist-credentials: false
27+
2428
- name: Build and Check Package
2529
uses: hynek/build-and-inspect-python-package@v1.5
2630

2731
deploy:
2832
if: github.repository == 'pytest-dev/pytest'
29-
needs: [build]
33+
needs: [package]
3034
runs-on: ubuntu-latest
35+
environment: deploy
3136
timeout-minutes: 30
3237
permissions:
3338
id-token: write
3439
steps:
40+
- uses: actions/checkout@v3
3541
- name: Download Package
3642
uses: actions/download-artifact@v3
3743
with:
3844
name: Packages
3945
path: dist
46+
4047
- name: Publish package to PyPI
4148
uses: pypa/gh-action-pypi-publish@v1.8.5
4249

50+
- name: Push tag
51+
run: |
52+
git config user.name "pytest bot"
53+
git config user.email "pytestbot@gmail.com"
54+
git tag --annotate --message=v${{ github.event.inputs.version }} v${{ github.event.inputs.version }} ${{ github.sha }}
55+
git push origin v${{ github.event.inputs.version }}
56+
4357
release-notes:
4458

4559
# todo: generate the content in the build job
@@ -55,11 +69,11 @@ jobs:
5569
with:
5670
fetch-depth: 0
5771
persist-credentials: false
72+
5873
- name: Set up Python
5974
uses: actions/setup-python@v4
6075
with:
61-
python-version: "3.7"
62-
76+
python-version: "3.10"
6377

6478
- name: Install tox
6579
run: |

‎.github/workflows/test.yml

+22-14
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,19 @@ concurrency:
2727
permissions: {}
2828

2929
jobs:
30+
package:
31+
runs-on: ubuntu-latest
32+
steps:
33+
- uses: actions/checkout@v3
34+
with:
35+
fetch-depth: 0
36+
persist-credentials: false
37+
- name: Build and Check Package
38+
uses: hynek/build-and-inspect-python-package@v1.5
39+
3040
build:
41+
needs: [package]
42+
3143
runs-on: ${{ matrix.os }}
3244
timeout-minutes: 45
3345
permissions:
@@ -60,7 +72,6 @@ jobs:
6072
"macos-py310",
6173
"macos-py312",
6274

63-
"docs",
6475
"doctesting",
6576
"plugins",
6677
]
@@ -159,10 +170,6 @@ jobs:
159170
os: ubuntu-latest
160171
tox_env: "plugins"
161172

162-
- name: "docs"
163-
python: "3.7"
164-
os: ubuntu-latest
165-
tox_env: "docs"
166173
- name: "doctesting"
167174
python: "3.7"
168175
os: ubuntu-latest
@@ -175,6 +182,12 @@ jobs:
175182
fetch-depth: 0
176183
persist-credentials: false
177184

185+
- name: Download Package
186+
uses: actions/download-artifact@v3
187+
with:
188+
name: Packages
189+
path: dist
190+
178191
- name: Set up Python ${{ matrix.python }}
179192
uses: actions/setup-python@v4
180193
with:
@@ -188,11 +201,13 @@ jobs:
188201
189202
- name: Test without coverage
190203
if: "! matrix.use_coverage"
191-
run: "tox -e ${{ matrix.tox_env }}"
204+
shell: bash
205+
run: tox run -e ${{ matrix.tox_env }} --installpkg `find dist/*.tar.gz`
192206

193207
- name: Test with coverage
194208
if: "matrix.use_coverage"
195-
run: "tox -e ${{ matrix.tox_env }}-coverage"
209+
shell: bash
210+
run: tox run -e ${{ matrix.tox_env }}-coverage --installpkg `find dist/*.tar.gz`
196211

197212
- name: Generate coverage report
198213
if: "matrix.use_coverage"
@@ -206,10 +221,3 @@ jobs:
206221
fail_ci_if_error: true
207222
files: ./coverage.xml
208223
verbose: true
209-
210-
check-package:
211-
runs-on: ubuntu-latest
212-
steps:
213-
- uses: actions/checkout@v3
214-
- name: Build and Check Package
215-
uses: hynek/build-and-inspect-python-package@v1.5

‎RELEASING.rst

+4-7
Original file line numberDiff line numberDiff line change
@@ -133,14 +133,11 @@ Releasing
133133

134134
Both automatic and manual processes described above follow the same steps from this point onward.
135135

136-
#. After all tests pass and the PR has been approved, tag the release commit
137-
in the ``release-MAJOR.MINOR.PATCH`` branch and push it. This will publish to PyPI::
136+
#. After all tests pass and the PR has been approved, trigger the ``deploy`` job
137+
in https://github.com/pytest-dev/pytest/actions/workflows/deploy.yml.
138138

139-
git fetch upstream
140-
git tag MAJOR.MINOR.PATCH upstream/release-MAJOR.MINOR.PATCH
141-
git push upstream MAJOR.MINOR.PATCH
142-
143-
Wait for the deploy to complete, then make sure it is `available on PyPI <https://pypi.org/project/pytest>`_.
139+
This job will require approval from ``pytest-dev/core``, after which it will publish to PyPI
140+
and tag the repository.
144141

145142
#. Merge the PR. **Make sure it's not squash-merged**, so that the tagged commit ends up in the main branch.
146143

‎changelog/10337.bugfix.rst

-2
This file was deleted.

‎changelog/10702.bugfix.rst

-1
This file was deleted.

‎changelog/10811.bugfix.rst

-2
This file was deleted.

‎doc/en/announce/index.rst

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Release announcements
66
:maxdepth: 2
77

88

9+
release-7.4.1
910
release-7.4.0
1011
release-7.3.2
1112
release-7.3.1

‎doc/en/announce/release-7.4.1.rst

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
pytest-7.4.1
2+
=======================================
3+
4+
pytest 7.4.1 has just been released to PyPI.
5+
6+
This is a bug-fix release, being a drop-in replacement. To upgrade::
7+
8+
pip install --upgrade pytest
9+
10+
The full changelog is available at https://docs.pytest.org/en/stable/changelog.html.
11+
12+
Thanks to all of the contributors to this release:
13+
14+
* Bruno Oliveira
15+
* Florian Bruhin
16+
* Ran Benita
17+
18+
19+
Happy testing,
20+
The pytest Development Team

‎doc/en/builtin.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a
2222
cachedir: .pytest_cache
2323
rootdir: /home/sweet/project
2424
collected 0 items
25-
cache -- .../_pytest/cacheprovider.py:528
25+
cache -- .../_pytest/cacheprovider.py:532
2626
Return a cache object that can persist state between testing sessions.
2727
2828
cache.get(key, default)

‎doc/en/changelog.rst

+17
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,23 @@ with advance notice in the **Deprecations** section of releases.
2828

2929
.. towncrier release notes start
3030
31+
pytest 7.4.1 (2023-09-02)
32+
=========================
33+
34+
Bug Fixes
35+
---------
36+
37+
- `#10337 <https://github.com/pytest-dev/pytest/issues/10337>`_: Fixed bug where fake intermediate modules generated by ``--import-mode=importlib`` would not include the
38+
child modules as attributes of the parent modules.
39+
40+
41+
- `#10702 <https://github.com/pytest-dev/pytest/issues/10702>`_: Fixed error assertion handling in :func:`pytest.approx` when ``None`` is an expected or received value when comparing dictionaries.
42+
43+
44+
- `#10811 <https://github.com/pytest-dev/pytest/issues/10811>`_: Fixed issue when using ``--import-mode=importlib`` together with ``--doctest-modules`` that caused modules
45+
to be imported more than once, causing problems with modules that have import side effects.
46+
47+
3148
pytest 7.4.0 (2023-06-23)
3249
=========================
3350

‎doc/en/example/reportingdemo.rst

+10-10
Original file line numberDiff line numberDiff line change
@@ -554,13 +554,13 @@ Here is a nice run of several failures and how ``pytest`` presents things:
554554
E AssertionError: assert False
555555
E + where False = <built-in method startswith of str object at 0xdeadbeef0027>('456')
556556
E + where <built-in method startswith of str object at 0xdeadbeef0027> = '123'.startswith
557-
E + where '123' = <function TestMoreErrors.test_startswith_nested.<locals>.f at 0xdeadbeef0029>()
558-
E + and '456' = <function TestMoreErrors.test_startswith_nested.<locals>.g at 0xdeadbeef002a>()
557+
E + where '123' = <function TestMoreErrors.test_startswith_nested.<locals>.f at 0xdeadbeef0006>()
558+
E + and '456' = <function TestMoreErrors.test_startswith_nested.<locals>.g at 0xdeadbeef0029>()
559559
560560
failure_demo.py:235: AssertionError
561561
_____________________ TestMoreErrors.test_global_func ______________________
562562
563-
self = <failure_demo.TestMoreErrors object at 0xdeadbeef002b>
563+
self = <failure_demo.TestMoreErrors object at 0xdeadbeef002a>
564564
565565
def test_global_func(self):
566566
> assert isinstance(globf(42), float)
@@ -571,18 +571,18 @@ Here is a nice run of several failures and how ``pytest`` presents things:
571571
failure_demo.py:238: AssertionError
572572
_______________________ TestMoreErrors.test_instance _______________________
573573
574-
self = <failure_demo.TestMoreErrors object at 0xdeadbeef002c>
574+
self = <failure_demo.TestMoreErrors object at 0xdeadbeef002b>
575575
576576
def test_instance(self):
577577
self.x = 6 * 7
578578
> assert self.x != 42
579579
E assert 42 != 42
580-
E + where 42 = <failure_demo.TestMoreErrors object at 0xdeadbeef002c>.x
580+
E + where 42 = <failure_demo.TestMoreErrors object at 0xdeadbeef002b>.x
581581
582582
failure_demo.py:242: AssertionError
583583
_______________________ TestMoreErrors.test_compare ________________________
584584
585-
self = <failure_demo.TestMoreErrors object at 0xdeadbeef002d>
585+
self = <failure_demo.TestMoreErrors object at 0xdeadbeef002c>
586586
587587
def test_compare(self):
588588
> assert globf(10) < 5
@@ -592,7 +592,7 @@ Here is a nice run of several failures and how ``pytest`` presents things:
592592
failure_demo.py:245: AssertionError
593593
_____________________ TestMoreErrors.test_try_finally ______________________
594594
595-
self = <failure_demo.TestMoreErrors object at 0xdeadbeef002e>
595+
self = <failure_demo.TestMoreErrors object at 0xdeadbeef002d>
596596
597597
def test_try_finally(self):
598598
x = 1
@@ -603,7 +603,7 @@ Here is a nice run of several failures and how ``pytest`` presents things:
603603
failure_demo.py:250: AssertionError
604604
___________________ TestCustomAssertMsg.test_single_line ___________________
605605
606-
self = <failure_demo.TestCustomAssertMsg object at 0xdeadbeef002f>
606+
self = <failure_demo.TestCustomAssertMsg object at 0xdeadbeef002e>
607607
608608
def test_single_line(self):
609609
class A:
@@ -618,7 +618,7 @@ Here is a nice run of several failures and how ``pytest`` presents things:
618618
failure_demo.py:261: AssertionError
619619
____________________ TestCustomAssertMsg.test_multiline ____________________
620620
621-
self = <failure_demo.TestCustomAssertMsg object at 0xdeadbeef0030>
621+
self = <failure_demo.TestCustomAssertMsg object at 0xdeadbeef002f>
622622
623623
def test_multiline(self):
624624
class A:
@@ -637,7 +637,7 @@ Here is a nice run of several failures and how ``pytest`` presents things:
637637
failure_demo.py:268: AssertionError
638638
___________________ TestCustomAssertMsg.test_custom_repr ___________________
639639
640-
self = <failure_demo.TestCustomAssertMsg object at 0xdeadbeef0031>
640+
self = <failure_demo.TestCustomAssertMsg object at 0xdeadbeef0030>
641641
642642
def test_custom_repr(self):
643643
class JSON:

‎doc/en/getting-started.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Install ``pytest``
2222
.. code-block:: bash
2323
2424
$ pytest --version
25-
pytest 7.4.0
25+
pytest 7.4.1
2626
2727
.. _`simpletest`:
2828

‎doc/en/how-to/tmp_path.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ Running this would result in a passed test except for the last
5151
d = tmp_path / "sub"
5252
d.mkdir()
5353
p = d / "hello.txt"
54-
p.write_text(CONTENT)
55-
assert p.read_text() == CONTENT
54+
p.write_text(CONTENT, encoding="utf-8")
55+
assert p.read_text(encoding="utf-8") == CONTENT
5656
assert len(list(tmp_path.iterdir())) == 1
5757
> assert 0
5858
E assert 0

‎doc/en/reference/reference.rst

+6-5
Original file line numberDiff line numberDiff line change
@@ -1887,11 +1887,12 @@ All the command-line flags can be obtained by running ``pytest --help``::
18871887
tests. Optional argument: glob (default: '*').
18881888
--cache-clear Remove all cache contents at start of test run
18891889
--lfnf={all,none}, --last-failed-no-failures={all,none}
1890-
With ``--lf``, determines whether to execute tests when there
1891-
are no previously (known) failures or when no
1892-
cached ``lastfailed`` data was found.
1893-
``all`` (the default) runs the full test suite again.
1894-
``none`` just emits a message about no known failures and exits successfully.
1890+
With ``--lf``, determines whether to execute tests
1891+
when there are no previously (known) failures or
1892+
when no cached ``lastfailed`` data was found.
1893+
``all`` (the default) runs the full test suite
1894+
again. ``none`` just emits a message about no known
1895+
failures and exits successfully.
18951896
--sw, --stepwise Exit on test failure and continue from last failing
18961897
test next time
18971898
--sw-skip, --stepwise-skip

0 commit comments

Comments
 (0)
Please sign in to comment.