Comments (8)
If you get a chance, can you try the https://github.com/spulec/freezegun/tree/ctypes branch on App Engine? It will eventually become master for freezegun once I get the python 3 tests passing.
from freezegun.
Any chance that the latest release fixes any of this?
If not, I probably will close as wont-fix unless we can find something wrong with freezegun outside of GAE. I do appreciate you opening the ticket regardless. The fixes will be helpful to future users who search for this.
from freezegun.
Experienced the same kind of issue with GAE. The ctypes branch indeed solves the problem without requiring any monkey-patching.
from freezegun.
Also stumbled on this with GAE. Any chance that the ctypes branch is merged to master?
from freezegun.
Can you confirm that the most recent version doesn't work? If it doesn't work, what happens?
from freezegun.
This is weird.. when I tried the latest version from pypi a week ago it was behaving like a no-op; it was using the current datetime instead of the faked one. Now I tried it again and it works but there's a different problem: it's much slower than the ctypes version. For the same single test:
-
after
pip install git+https://github.com/spulec/freezegun.git@ctypes
real 0m0.982s
user 0m0.826s
sys 0m0.156s -
after
pip install freezegun==0.3.2
real 0m17.678s
user 0m16.077s
sys 0m1.591s
Same observation with other tests too.
from freezegun.
Probably the same as #69
You could try an older version until that issue is resolved.
from freezegun.
After digging into it with the profiler, I isolated it to the import of six.moves
:
$ python -m timeit "from freezegun import freeze_time; freeze_time('2012-01-14').start()"
1000 loops, best of 3: 1.85 msec per loop
$ python -m timeit "import six; from freezegun import freeze_time; freeze_time('2012-01-14').start()"
1000 loops, best of 3: 1.93 msec per loop
$ python -m timeit "import six.moves; from freezegun import freeze_time; freeze_time('2012-01-14').start()"
10 loops, best of 3: 301 msec per loop
from freezegun.
Related Issues (20)
- Maintenance plans HOT 3
- 1.3.0: `freezegun/__init__.py` is missing new version number HOT 1
- [Discussion] about freezing asyncio HOT 7
- ``PermissionError: [Errno 1] Operation not permitted`` appears when upgrading to ``1.3.0`` HOT 7
- Freezegun doesn't mock pointers to date functions HOT 1
- Tag for 1.2.2 is missing HOT 1
- Python 3.12: Deprecation warnings related to datetime.datetime.utcfromtimestamp HOT 2
- Time is not freezed when using `uvloop` event loop
- unsupported operand type(s) for +: 'FakeDatetime' and 'FakeDatetime'
- Datetime and Time packages do not have the same behavior when being frozen HOT 4
- timezone free datetime.datetime.fromtimestamp returns original datetime.datetime HOT 1
- Adding a return value to tick()
- Could have some problem with Django with TIME_ZONE setting
- Test regressions on Python 3.13.0b1 HOT 2
- `FakeDatetime`'s `timestamp()` is not consistent with `datetime().timestamp()` HOT 1
- consider overriding == on FakeDatetimeMeta HOT 2
- Freeze time doesn't work with FastAPI + pydantic V2 HOT 2
- [Bug] `tz_offset` shifts `datetime` which is instantiated with `tz` argument
- Possible to patch user-defined functions?
- FG incorrectly causes monotonic time to go back
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from freezegun.