time-machine icon indicating copy to clipboard operation
time-machine copied to clipboard

Travel through time in your tests.

Results 25 time-machine issues
Sort by recently updated
recently updated
newest added

### Description Python defaults to interpreting naive datetimes as local time: https://blog.ganssle.io/articles/2022/04/naive-local-datetimes.html time-machine currently turns naive datetimes into UTC, *except* from naive datetiems parsed from strings with datetutil, which it...

### Description It would be convenient if `TimeMachineFixture` supported `shift` in addition to `move_to`. You can work around the lack of this by doing `time_machine.coordinates.shift(...)`, but it's slightly more verbose...

### Description This referes to this [PR](https://github.com/adamchainz/time-machine/pull/220) ``` The purpose of the above pr is to allow the entire datetime class to be mocked with the real datetime information as...

Hi @adamchainz ! Thanks for this great library! If it does not come with a too high performance impact, similar to https://github.com/ktosiek/pytest-freezegun/pull/14/files consider supporting travel as a marker? Best, Matthieu

Closes #103, still wip :) TODO: - [ ] time.monotonic_ns() - [ ] time.clock_gettime() when called with time.CLOCK_MONOTONIC or time.CLOCK_MONOTONIC_RAW

python-dateutil is only used for the parsing of strings, which many users don't need. We should make python-dateutil an optional dependency in extras_require, to avoid dependency bloat.

Hi @adamchainz 👋 would be possible to get support for `time.monotonic_ns`? I can try to send a PR if you give me some pointers, I'm not really familiar with c...

It would offset the current time by the given amount, which would be pretty useful for some tests that check "X is true until N minutes in the future"

This syntax comes from [freezegun](https://github.com/spulec/freezegun). Supporting it will make it easier for people to compare and switch from freezegun.

### Python Version 3.10.13 ### pytest Version _No response_ ### Package Version 2.13.0 ### Description When upgrading from 2.12 to 2.13 one Django (4.2.5) test always freezes, but only in...