You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can't use the python package freezegun with my tests and sniffer, I get the issue below.
To reproduce:
Create a file tests.py:
import unittest
from freezegun import freeze_time
class MyTestCase(unittest.TestCase):
@freeze_time("2015-06-22T17:28:00Z")
def test_thing(self):
pass
Then pip install freezegun
Then
sniffer
Then change a line in tests.py, the second time the tests are run you get this error:
ERROR: Failure: AttributeError ('NoneType' object has no attribute 'timedelta')
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/nose/loader.py", line 418, in loadTestsFromName
addr.filename, addr.module)
File "/usr/local/lib/python2.7/dist-packages/nose/importer.py", line 47, in importFromPath
return self.importFromDir(dir_path, fqname)
File "/usr/local/lib/python2.7/dist-packages/nose/importer.py", line 94, in importFromDir
mod = load_module(part_fqname, fh, filename, desc)
File "/x/test.py", line 2, in <module>
from freezegun import freeze_time
File "/usr/local/lib/python2.7/dist-packages/freezegun/__init__.py", line 18, in <module>
from .api import freeze_time
File "/usr/local/lib/python2.7/dist-packages/freezegun/api.py", line 10, in <module>
from dateutil import parser
File "/usr/local/lib/python2.7/dist-packages/dateutil/parser.py", line 942, in <module>
DEFAULTPARSER = parser()
File "/usr/local/lib/python2.7/dist-packages/dateutil/parser.py", line 341, in __init__
self.info = info or parserinfo()
File "/usr/local/lib/python2.7/dist-packages/dateutil/parser.py", line 259, in __init__
self._year = time.localtime().tm_year
File "/usr/local/lib/python2.7/dist-packages/freezegun/api.py", line 53, in __call__
shifted_time = self.time_to_freeze() - datetime.timedelta(seconds=time.timezone)
AttributeError: 'NoneType' object has no attribute 'timedelta'
----------------------------------------------------------------------
Ran 1 test in 0.006s
FAILED (errors=1)
Failed - Back to work!
The text was updated successfully, but these errors were encountered:
I can't use the python package freezegun with my tests and sniffer, I get the issue below.
To reproduce:
Create a file tests.py:
Then
pip install freezegun
Then
Then change a line in tests.py, the second time the tests are run you get this error:
The text was updated successfully, but these errors were encountered: