Skip to content

Conversation

@dependabot
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Dec 1, 2025

Bumps time-machine from 2.19.0 to 3.1.0.

Changelog

Sourced from time-machine's changelog.

3.1.0 (2025-11-21)

  • Optimize patching of uuid module. By avoiding using unittest.mock, this small overhead from starting time_machine.travel() has been reduced about 20x, from ~600ns to ~30ns by one benchmark.

    PR [#585](https://github.com/adamchainz/time-machine/issues/585) <https://github.com/adamchainz/time-machine/pull/585>__.

3.0.0 (2025-11-18)

  • Remove mocking of time.monotonic() and time.monotonic_ns().

    This mocking caused too many issues, such as causing freezes in asyncio event loops (Issue [#387](https://github.com/adamchainz/time-machine/issues/387) <https://github.com/adamchainz/time-machine/issues/387>), preventing pytest-durations from timing tests correctly (Issue [#505](https://github.com/adamchainz/time-machine/issues/505) <https://github.com/adamchainz/time-machine/issues/505>), and triggering timeouts in psycopg (Issue [#509](https://github.com/adamchainz/time-machine/issues/509) <https://github.com/adamchainz/time-machine/issues/509>__). The root cause here is that mocking the monotonic clock breaks its contract, allowing it to move backwards when it’s meant to only move forwards.

    As an alternative, use |unittest.mock|__ to mock the monotonic function for the specific tested modules that need it. That means that your code should import monotonic() or monotonic_ns() directly, so that your tests can mock it in those places only. For example, if your system under test looks like:

    .. |unittest.mock| replace:: unittest.mock __ https://docs.python.org/3/library/unittest.mock.html

    .. code-block:: python

    # example.py
    from time import monotonic
    

    def measurement(): start = monotonic() ... end = monotonic() return end - start

    …then your tests can mock monotonic() like this:

    .. code-block:: python

    from unittest import TestCase, mock
    

    import example

    class MeasurementTests(TestCase): def test_success(self): with mock.patch.object(example, "monotonic", side_effect=[0.0, 1.23]): result = example.measurement() assert result == 1.23

... (truncated)

Commits

Dependabot compatibility score

Dependabot 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 rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [time-machine](https://github.com/adamchainz/time-machine) from 2.19.0 to 3.1.0.
- [Changelog](https://github.com/adamchainz/time-machine/blob/main/docs/changelog.rst)
- [Commits](adamchainz/time-machine@2.19.0...3.1.0)

---
updated-dependencies:
- dependency-name: time-machine
  dependency-version: 3.1.0
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot added part:tooling Affects the development tooling (CI, deployment, dependency management, etc.) type:tech-debt Improves the project without visible changes for users labels Dec 1, 2025
@dependabot dependabot bot requested review from a team as code owners December 1, 2025 16:02
@dependabot dependabot bot added the part:tooling Affects the development tooling (CI, deployment, dependency management, etc.) label Dec 1, 2025
@dependabot dependabot bot requested review from stefan-brus-frequenz and removed request for a team December 1, 2025 16:02
@dependabot dependabot bot added the type:tech-debt Improves the project without visible changes for users label Dec 1, 2025
@dependabot dependabot bot requested review from llucax and removed request for a team December 1, 2025 16:02
@github-actions github-actions bot added part:dispatcher auto-merged Auto-approved Dependabot PRs labels Dec 1, 2025
@github-actions github-actions bot enabled auto-merge December 1, 2025 16:02
@github-actions github-actions bot added this pull request to the merge queue Dec 1, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Dec 1, 2025
@Marenz Marenz added this pull request to the merge queue Dec 2, 2025
@dependabot @github
Copy link
Contributor Author

dependabot bot commented on behalf of github Dec 2, 2025

Dependabot attempted to update this pull request, but because the branch dependabot/pip/time-machine-3.1.0 is protected it was unable to do so.

Merged via the queue into v1.x.x with commit 2f0821b Dec 2, 2025
11 checks passed
@Marenz Marenz deleted the dependabot/pip/time-machine-3.1.0 branch December 2, 2025 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-merged Auto-approved Dependabot PRs part:dispatcher part:tooling Affects the development tooling (CI, deployment, dependency management, etc.) type:tech-debt Improves the project without visible changes for users

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants