Ronny Pfannschmidt
b1c430820f
Merge pull request #11794 from bluetech/fixturedef-ref-cycle
...
A few cleanups
2024-01-10 06:44:14 +01:00
Ran Benita
35a3863b15
config: clarify a bit of code in `_importconftest`
2024-01-09 23:49:03 +02:00
Ran Benita
368fa2c03e
fixtures: remove unhelpful FixtureManager.{FixtureLookupError,FixtureLookupErrorRepr}
...
Couldn't find any reason for this indirection, nor any plugins which
rely on it. Seems like historically it was done to avoid some imports...
2024-01-09 23:33:07 +02:00
Ran Benita
372c17e228
fixtures: avoid FixtureDef <-> FixtureManager reference cycle
...
There is no need to store the FixtureManager on each FixtureDef.
2024-01-09 23:29:58 +02:00
Ran Benita
c4a356eaee
Merge pull request #11718 from pytest-dev/dependabot/github_actions/hynek/build-and-inspect-python-package-2.0.0
...
build(deps): Bump hynek/build-and-inspect-python-package from 1.5.4 to 2.0.0
2024-01-09 21:44:43 +02:00
dependabot[bot]
2270cab1c2
build(deps): Bump actions/download-artifact from 3 to 4
...
Bumps [actions/download-artifact](https://github.com/actions/download-artifact ) from 3 to 4.
- [Release notes](https://github.com/actions/download-artifact/releases )
- [Commits](https://github.com/actions/download-artifact/compare/v3...v4 )
---
updated-dependencies:
- dependency-name: actions/download-artifact
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com>
2024-01-09 21:12:42 +02:00
dependabot[bot]
956d0e5e9d
build(deps): Bump hynek/build-and-inspect-python-package
...
Bumps [hynek/build-and-inspect-python-package](https://github.com/hynek/build-and-inspect-python-package ) from 1.5.4 to 2.0.0.
- [Release notes](https://github.com/hynek/build-and-inspect-python-package/releases )
- [Changelog](https://github.com/hynek/build-and-inspect-python-package/blob/main/CHANGELOG.md )
- [Commits](https://github.com/hynek/build-and-inspect-python-package/compare/v1.5.4...v2.0.0 )
---
updated-dependencies:
- dependency-name: hynek/build-and-inspect-python-package
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com>
2024-01-09 21:12:27 +02:00
pre-commit-ci[bot]
7bc8385924
[pre-commit.ci] pre-commit autoupdate ( #11792 )
...
updates:
- [github.com/PyCQA/flake8: 6.1.0 → 7.0.0](https://github.com/PyCQA/flake8/compare/6.1.0...7.0.0 )
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-01-08 21:19:35 +00:00
Ran Benita
9b7e10a3c0
Merge pull request #11788 from pytest-dev/dependabot/pip/testing/plugins_integration/pytest-asyncio-0.23.3
...
build(deps): Bump pytest-asyncio from 0.23.2 to 0.23.3 in /testing/plugins_integration
2024-01-08 22:40:47 +02:00
dependabot[bot]
913d93debb
build(deps): Bump pytest-asyncio in /testing/plugins_integration
...
Bumps [pytest-asyncio](https://github.com/pytest-dev/pytest-asyncio ) from 0.23.2 to 0.23.3.
- [Release notes](https://github.com/pytest-dev/pytest-asyncio/releases )
- [Commits](https://github.com/pytest-dev/pytest-asyncio/compare/v0.23.2...v0.23.3 )
---
updated-dependencies:
- dependency-name: pytest-asyncio
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2024-01-08 20:24:22 +00:00
Ran Benita
97dfc3429e
Merge pull request #11785 from bluetech/matchfactories-nodes
...
fixtures: match fixtures based on actual node hierarchy, not textual nodeids
2024-01-08 22:23:08 +02:00
Ran Benita
992d0f082f
fixtures: match fixtures based on actual node hierarchy, not textual nodeids
...
Refs #11662 .
--- Problem
Each fixture definition has a "visibility", the `FixtureDef.baseid`
attribute. This is nodeid-like string. When a certain `node` requests a
certain fixture name, we match node's nodeid against the fixture
definitions with this name.
The matching currently happens on the *textual* representation of the
nodeid - we split `node.nodeid` to its "parent nodeids" and then check
if the fixture's `baseid` is in there.
While this has worked so far, we really should try to avoid textual
manipulation of nodeids as much as possible. It has also caused problem
in an odd case of a `Package` in the root directory: the `Package` gets
nodeid `.`, while a `Module` in it gets nodeid `test_module.py`. And
textually, `.` is not a parent of `test_module.py`.
--- Solution
Avoid this entirely by just checking the node hierarchy itself. This is
made possible by the fact that we now have proper `Directory` nodes
(`Dir` or `Package`) for the entire hierarchy.
Also do the same for `_getautousenames` which is a similar deal.
The `iterparentnodeids` function is no longer used and is removed.
2024-01-08 21:36:51 +02:00
Ran Benita
b968f63ca5
Merge pull request #11780 from bluetech/register-fixture
...
Add an internal "register fixture" API and use it replace object patching for fixture injection
2024-01-08 21:24:54 +02:00
Ran Benita
c8792bd080
python,unittest: replace obj fixture patching with `FixtureManager._register_fixture`
...
Instead of modifying user objects like modules and classes that we
really shouldn't be touching, use the new `_register_fixture` internal
API to do it directly.
2024-01-08 21:02:59 +02:00
Ran Benita
3234c79ee5
fixtures: add an internal API for registering a fixture
...
Add a function on the `FixtureManager` to register a fixture with
pytest. Currently this can only be done through `parsefactories`.
My aim is to eventually make something like this available to plugins,
as it's a pretty common need.
2024-01-08 21:02:59 +02:00
Ran Benita
851b72f289
Merge pull request #11776 from bluetech/unittest-xunit-inline
...
unittest: inline `_make_xunit_fixture`
2024-01-08 21:02:24 +02:00
Ran Benita
1d7349d18c
Merge pull request #11774 from bluetech/fspath-cleanups
...
Small `fspath` cleanups
2024-01-08 21:01:56 +02:00
github-actions[bot]
5747a6c06e
[automated] Update plugin list ( #11784 )
...
Co-authored-by: pytest bot <pytestbot@users.noreply.github.com>
2024-01-07 10:20:38 -03:00
Fabian Sturm
13eacdad8a
Add summary for xfails with -rxX option ( #11574 )
...
Co-authored-by: Brian Okken <1568356+okken@users.noreply.github.com>
2024-01-05 09:59:19 -03:00
Ran Benita
a616adf3ae
unittest: inline `_make_xunit_fixture`
...
The indirection makes things harder to follow in this case IMO.
2024-01-05 14:37:03 +02:00
Ran Benita
685e52ec30
nodes: fix attribute name `fspath` -> `path` in `get_fslocation_from_item`
2024-01-04 22:32:34 +02:00
Ran Benita
7b4ab8134e
fixtures: remove unnecessary `fspath` workaround
2024-01-04 22:32:34 +02:00
Ran Benita
c2a4a8d518
Merge pull request #11769 from neutrinoceros/fix_warns_docstring
...
Fix a mistake in pytest.warns' docstring (expect_warning accepts tuples, not any sequence)
2024-01-04 14:27:49 +02:00
Clément Robert
ac96256272
Fix a mistake in pytest.warns' docstring (expect_warning accepts tuples, not any sequence)
2024-01-04 11:51:12 +01:00
Bruno Oliveira
d38193646d
Update docstring of scripts/generate-gh-release-notes.py ( #11767 )
...
Follow up to #11754 .
2024-01-04 07:29:20 -03:00
Bruno Oliveira
cd07177906
Merge pull request #11754 from nicoddemus/release-notes
...
Improve GitHub release workflow
2024-01-03 20:14:48 -03:00
Bruno Oliveira
6321b74fae
Enable type-checking in scripts/
2024-01-03 19:47:56 -03:00
Bruno Oliveira
5aa289e478
Improve GitHub release workflow
...
This changes the existing script to just generate the release notes and delegate the actual publishing to the `softprops/action-gh-release@v1` action.
This allows us to delete the custom code, which failed recently in https://github.com/pytest-dev/pytest/actions/runs/7370258570/job/20056477756 .
2024-01-03 19:47:56 -03:00
Ben Brown
12b9bd5801
Fix teardown error reporting when `--maxfail=1` ( #11721 )
...
Co-authored-by: Ran Benita <ran@unusedvar.com>
2024-01-03 19:39:24 +02:00
Ran Benita
f017df443a
Merge pull request #11757 from bluetech/rm-removed-in-8
...
Remove pytest 8 deprecations
2024-01-03 16:53:10 +02:00
Ran Benita
1ba07450e4
doc/deprecations: fix incorrect title level
2024-01-03 14:29:45 +02:00
Ran Benita
215f4d1fab
Remove `PytestRemovedIn8Warning`
...
Per our deprecation policy.
2024-01-03 14:29:45 +02:00
Ran Benita
6c89f9261c
Remove deprecated py.path (`fspath`) node constructor arguments
2024-01-03 14:29:45 +02:00
Ran Benita
a98f02d423
Remove deprecated py.path hook arguments
2024-01-03 14:29:42 +02:00
Marc Bresson
effc2b0529
Clarified `markers` ini property. Fix #11738 ( #11739 )
2024-01-03 14:20:54 +02:00
Ran Benita
2c5c97b6d1
Merge pull request #11760 from bluetech/fix-highlight-empty-source
...
terminalwriter: fix crash trying to highlight empty source
2024-01-03 09:38:29 +02:00
Ran Benita
cb5a42c836
terminalwriter: fix crash trying to highlight empty source
...
For quick checking I don't know how we can reach here with an empty
source, so test just checks the function directly.
Fix #11758 .
2024-01-02 19:37:24 +02:00
Ran Benita
0f18a7fe5e
Remove deprecated nose support
2024-01-02 12:20:47 +02:00
Ran Benita
0591569b4b
Remove deprecated pytest.{exit,fail,skip}(msg=...) argument
2024-01-02 12:20:47 +02:00
Ran Benita
477959ef7d
Remove deprecated `pytest.Instance` backward compat
2024-01-02 12:20:47 +02:00
Ran Benita
4147c92b21
Remove deprecated `pytest.warns(None)`
2024-01-02 12:20:47 +02:00
Ran Benita
10fbb2325f
Remove deprecated `Parser.addoption` backward compatibilities
2024-01-02 12:20:47 +02:00
Ran Benita
1f8b39ed32
Remove deprecated `--strict` option
2024-01-02 12:20:47 +02:00
Ran Benita
f4e7b0d6e0
Remove deprecated `pytest_cmdline_preparse` hook
2024-01-02 12:20:47 +02:00
Ran Benita
f13724e2e3
Remove deprecated {FSCollector,Package}.{gethookproxy,isinitpath}
2024-01-02 12:20:47 +02:00
Ran Benita
a53984a55b
Merge pull request #11756 from pytest-dev/cherry-pick-release
...
Cherry pick 8.0.0rc1 release notes
2024-01-02 11:20:03 +02:00
Ran Benita
d3c7ba310c
Merge pull request #11744 from pytest-dev/release-8.0.0rc1
...
Prepare release 8.0.0rc1
(cherry picked from commit 665e4e58d3fba8319e922674c286e92f070e6ec3)
2024-01-02 10:59:26 +02:00
Ran Benita
6bec880283
Merge pull request #11753 from bluetech/cherry-pick-release
...
Cherry-pick 7.4.4 release notes
2023-12-31 14:26:50 +02:00
Ran Benita
a1b6b7473b
Merge pull request #11752 from pytest-dev/release-7.4.4
...
Prepare release 7.4.4
(cherry picked from commit 18dcd9d38d18fc01bf1f7f5f60db69f785957101)
2023-12-31 14:15:46 +02:00
Ran Benita
3701d1218b
Merge pull request #11746 from pytest-dev/update-plugin-list/patch-acd445a3f
...
[automated] Update plugin list
2023-12-31 10:26:34 +02:00