Failing to freeze with pytest
See original GitHub issueStack trace below. Under python 2.7.17.
In [3]: from freezegun import freeze_time
In [4]: freezer = freeze_time("2012-01-14 12:00:01")
In [5]: freezer.start()
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
/Users/leonsas/Projects/Hypnos/hypnos/sleep_plan/plan_review.pyc in <module>()
----> 1 freezer.start()
/usr/local/lib/python2.7/site-packages/freezegun/api.pyc in start(self)
381 elif (not hasattr(module, "__name__") or module.__name__ in ('datetime', 'time')):
382 continue
--> 383 for module_attribute in dir(module):
384 if module_attribute in real_names:
385 continue
TypeError: py.test.cmdline.__dict__ is not a dictionary
And seems like cmdline
is None
:
In [12]: import py.test.cmdline
In [13]: type(py.test.cmdline)
Out[13]: NoneType
Not sure exactly what’s going on. Happy to give more environment context to figure this out.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:4
- Comments:6 (3 by maintainers)
Top Results From Across the Web
py.test freezes after collecting items - Stack Overflow
py.test freezes after collecting items · 2. Can you try running test-by-test (using -k test_name) to see if this caused by any single...
Read more >pytest stuck after assertion fail · Issue #7989 - GitHub
Detailed Description I'm writing pytest test cases for aiosmtpd, and I'm hitting this problem against master in aio-libs/aiosmtpd Minimal ...
Read more >That FreezeGun doesn't work with Pytest fixtures (unless you ...
That is, this test fails when run on any date other than 2021-07-01: import datetime import freezegun import pytest @pytest.fixture() def ...
Read more >How To Debug A Hanging Test Using Pytest - PyBites
Today a wanted to share a neat trick that might save you some headache: debugging a hanging test.
Read more >pytest-freeze-reqs - PyPI
Pytest plugin that tests if requirements are frozen. **/req*.txt and **/req*.pip are the patterns of path to match. ok and not ok lines...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Same issue! Any idea?
I’m going to close. Feel free to reopen with a script to reproduce this.