Bump the minor group across 1 directory with 4 updates - #1445
Conversation
Bumps the minor group with 4 updates in the / directory: [mypy](https://github.com/python/mypy), [nox](https://github.com/wntrblm/nox), [pytest](https://github.com/pytest-dev/pytest) and [hypothesis](https://github.com/HypothesisWorks/hypothesis). Updates `mypy` from 2.1.0 to 2.3.0 - [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md) - [Commits](python/mypy@v2.1.0...v2.3.0) Updates `nox` from 2026.4.10 to 2026.7.11 - [Release notes](https://github.com/wntrblm/nox/releases) - [Changelog](https://github.com/wntrblm/nox/blob/main/CHANGELOG.md) - [Commits](wntrblm/nox@2026.04.10...2026.07.11) Updates `pytest` from 9.0.3 to 9.1.1 - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](pytest-dev/pytest@9.0.3...9.1.1) Updates `hypothesis` from 6.155.7 to 6.163.0 - [Release notes](https://github.com/HypothesisWorks/hypothesis/releases) - [Commits](HypothesisWorks/hypothesis@v6.155.7...v6.163.0) --- updated-dependencies: - dependency-name: mypy dependency-version: 2.3.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: minor - dependency-name: nox dependency-version: 2026.7.11 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: minor - dependency-name: pytest dependency-version: 9.1.1 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: minor - dependency-name: hypothesis dependency-version: 6.163.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: minor ... Signed-off-by: dependabot[bot] <support@github.com>
|
Fixed the issues with the new pytest version having a new |
| def approx_time( | ||
| expected: datetime | timedelta, | ||
| *, | ||
| abs: timedelta = timedelta(milliseconds=1), # pylint: disable=redefined-builtin |
There was a problem hiding this comment.
I'd rename it to something different rather than redefining the built-in abs and disabling the linter.
I'd suggest abs_tol as this is a common name used in math library.
There was a problem hiding this comment.
I'm not sure, this is a wrapper over pytest.approx() now, that uses abs as argument.
There was a problem hiding this comment.
I saw it before posting my comment and I think/thought what they are doing is not entirely correct (Even pytest documentation renders abs as built-in).
Probably short parameters like rel and abs make sense within the context and for testing purposes. But It is bad that is clashes with the built-in.
Internally they use long constant names:
DEFAULT_ABSOLUTE_TOLERANCE = Decimal("1e-12")
DEFAULT_RELATIVE_TOLERANCE = Decimal("1e-6")Anyway it's is fine to keep it aligned with pytest but still doesn't seem totally right to me 👼
There was a problem hiding this comment.
Haha, I get your point, but in this case I think it makes sense to follow upstream. This is targeting users knowing the pytest.approx() API, we want the principle of the least surprise given the current context.
daniel-zullo-frequenz
left a comment
There was a problem hiding this comment.
I have a comment to check for, LGTM otherwise
`approx_time` was a subclass of the private `_pytest.python_api.ApproxBase`,
written because `pytest.approx()` did not support `datetime`/`timedelta`.
The comment on the import pointed at the upstream issue tracking this:
pytest-dev/pytest#8395
That issue was fixed in pytest 9.1.0, which we now depend on: `approx()`
dispatches `datetime`/`timedelta` to a new `ApproxTimedelta` class doing
exactly what our own implementation did. So `approx_time` becomes a thin
wrapper that only defaults the tolerance to 1ms, since `approx()` requires
an explicit tolerance for these types.
Besides dropping the dependency on a private pytest API, this also gives
better failure output, as `ApproxTimedelta` implements `_repr_compare()`,
which our subclass didn't, so it now reports the absolute difference and
the tolerance instead of only the expected value.
Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
pytest 9.1.0 added proper support for `datetime`/`timedelta` in
`pytest.approx()`, and as part of it, it now refuses to guess a
tolerance for these types, raising instead:
TypeError: pytest.approx() requires an explicit tolerance for
datetime/timedelta comparisons: e.g. approx(expected,
abs=timedelta(seconds=1)) or approx(expected, rel=0.01)
This broke 12 tests in `test_clocksinfo.py` and `test_config.py`, which
were using the bare `pytest.approx()` on `timedelta`s instead of the
`approx_time()` helper used everywhere else in this test package.
These assertions never really used a tolerance anyway: all the compared
values are exact, so they only ever succeeded through the exact-equality
short-circuit in `approx()`, before any tolerance was computed.
Switching them to `approx_time()` provides the required tolerance (1ms
by default) and makes the whole test package consistent.
Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
b8f2d09 to
b0929bc
Compare
Bumps the minor group with 4 updates in the / directory: mypy, nox, pytest and hypothesis.
Updates
mypyfrom 2.1.0 to 2.3.0Changelog
Sourced from mypy's changelog.
... (truncated)
Commits
8aabf84Drop +dev from version4d8ad2aUpdate changelog for 2.3 release (#21728)2c21546[mypyc] Update documentation of race conditions under free threading (#21726)a9f62a3[mypyc] Make attribute access memory safe on free-threaded builds (#21705)0faa413UsePYODIDEenvironment variable for Emscripten cross-compilation detection...3d75cdb[mypyc] Borrow final attributes more aggressively (#21702)24c237d[mypyc] Improve documentation of Final (#21713)b5be217[mypyc] Update free threading Python compatibility docs (#21711)cbcb51aNarrow for frozendict membership check (#21709)af2bc0fSync typeshed (#21707)Updates
noxfrom 2026.4.10 to 2026.7.11Release notes
Sourced from nox's releases.
... (truncated)
Changelog
Sourced from nox's changelog.
... (truncated)
Commits
3284968chore: prepare release 2026.07.11 (#1132)d73f96aci: add Python 3.15 to the test matrix and classifiers (#1133)5391985test: isolate run_nox envdir to fix flaky test_main_requires (#1134)390d817feat: add return_code to CommandFailed. (#1129)f1d5210chore(deps): bump the github-actions group with 2 updates (#1125)0894b73chore(deps): bump the pre-commit group with 4 updates (#1126)9b747edci: experimental MSYS2/MinGW test run (#1122)8a44270docs: add PyO3 as a user (#1123)5bd0f83perf: lazy modules on Python 3.15 (#1115)982fcfachore(deps): bump dependency-groups in the pre-commit group (#1121)Updates
pytestfrom 9.0.3 to 9.1.1Release notes
Sourced from pytest's releases.
... (truncated)
Commits
cf470ecPrepare release version 9.1.1e0c8ce6Merge pull request #14625 from pytest-dev/patchback/backports/9.1.x/a07c31a97...1b82d16Merge pull request #14624 from pytest-dev/patchback/backports/9.1.x/b375b79ec...501c4bcMerge pull request #14596 from bluetech/doc-classmethodb61f588Merge pull request #14622 from chrisburr/fix-14608-initial-conftest-test-subdir9a567e0[automated] Update plugin list (#14617) (#14618)ef8b299Merge pull request #14620 from pytest-dev/patchback/backports/9.1.x/680f9f3ed...66abd07Merge pull request #14220 from bysiber/fix-stale-iexp-raisesgroup79fbf93Merge pull request #14612 from pytest-dev/patchback/backports/9.1.x/974ed48b6...0d312ebMerge pull request #14611 from bluetech/parametrize-argvalues-typingUpdates
hypothesisfrom 6.155.7 to 6.163.0Commits
793e92dBump hypothesis version to 6.163.0 and update changelogba2899bMerge pull request #4830 from Liam-DeVoe/from-regex-alphabet-collections5e3cae2Bump hypothesis version to 6.162.0 and update changelogd92a798Merge pull request #4811 from Zac-HD/claude/sleepy-keller-o5cUKf5e473aclaude: support Collection[str] alphabet in from_regex, unify alphabet valida...cbf124bSkip non-ns dtype construction at import on pandas < 28d0a004Address review: constrain constant-offset range, simplify tz classification8852abeadd new test72d88bdsimplify tests0addb38Support timezone-aware datetime dtypes in hypothesis.extra.pandasDependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebasewill rebase this PR@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it@dependabot show <dependency name> ignore conditionswill show all of the ignore conditions of the specified dependency@dependabot ignore <dependency name> major versionwill close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself)@dependabot ignore <dependency name> minor versionwill close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself)@dependabot ignore <dependency name>will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself)@dependabot unignore <dependency name>will remove all of the ignore conditions of the specified dependency@dependabot unignore <dependency name> <ignore condition>will remove the ignore condition of the specified dependency and ignore conditions