Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Two tests failing at head #376

Open
tedsilb opened this issue Dec 21, 2020 · 3 comments
Open

Two tests failing at head #376

tedsilb opened this issue Dec 21, 2020 · 3 comments

Comments

@tedsilb
Copy link

tedsilb commented Dec 21, 2020

Hello,

Two tests appear to be failing at head.

  • tests/test_datetimes.py::TestUnitTestMethodDecorator::test_method_decorator_works_on_unittest_kwarg_hello()
  • tests/test_datetimes.py::TestUnitTestMethodDecorator::test_method_decorator_works_on_unittest_kwarg_frozen_time()

Here is my terminal output using a clean clone of the code on Python 3.8 on macOS. I can also reproduce on 3.6 on Linux, so it doesn't seem environment-specific.

ted@macbook ~/D/Repos> git clone https://github.com/spulec/freezegun.git
Cloning into 'freezegun'...
remote: Enumerating objects: 75, done.
remote: Counting objects: 100% (75/75), done.
remote: Compressing objects: 100% (57/57), done.
remote: Total 2170 (delta 33), reused 40 (delta 18), pack-reused 2095
Receiving objects: 100% (2170/2170), 812.84 KiB | 3.15 MiB/s, done.
Resolving deltas: 100% (1213/1213), done.
ted@macbook ~/D/Repos> cd freezegun/
ted@macbook ~/D/R/freezegun (master)> tox
GLOB sdist-make: /Users/ted/Development/Repos/freezegun/setup.py
py35 create: /Users/ted/Development/Repos/freezegun/.tox/py35
ERROR: InterpreterNotFound: python3.5
py36 create: /Users/ted/Development/Repos/freezegun/.tox/py36
ERROR: InterpreterNotFound: python3.6
py37 create: /Users/ted/Development/Repos/freezegun/.tox/py37
ERROR: InterpreterNotFound: python3.7
py38 create: /Users/ted/Development/Repos/freezegun/.tox/py38
py38 installdeps: -rrequirements.txt
py38 inst: /Users/ted/Development/Repos/freezegun/.tox/.tmp/package/1/freezegun-1.0.0.zip
py38 installed: attrs==20.3.0,certifi==2020.12.5,chardet==4.0.0,coverage==5.3.1,coveralls==2.2.0,dateparser==1.0.0,docopt==0.6.2,freezegun @ file:///Users/ted/Development/Repos/freezegun/.tox/.tmp/package/1/freezegun-1.0.0.zip,humanize==3.2.0,idna==2.10,iniconfig==1.1.1,maya==0.6.1,packaging==20.8,pendulum==2.1.2,pluggy==0.13.1,py==1.10.0,pyparsing==2.4.7,pytest==6.2.1,pytest-cov==2.10.1,pytest-cover==3.0.0,pytest-coverage==0.0,python-dateutil==2.8.1,pytz==2020.4,pytzdata==2020.1,regex==2020.11.13,requests==2.25.1,six==1.15.0,snaptime==0.2.4,toml==0.10.2,tzlocal==2.1,urllib3==1.26.2
py38 run-test-pre: PYTHONHASHSEED='4261022987'
py38 run-test: commands[0] | pytest --cov
======================================= test session starts ========================================
platform darwin -- Python 3.8.0, pytest-6.2.1, py-1.10.0, pluggy-0.13.1
cachedir: .tox/py38/.pytest_cache
rootdir: /Users/ted/Development/Repos/freezegun
plugins: cov-2.10.1
collected 117 items

tests/test_asyncio.py ..                                                                     [  1%]
tests/test_class_import.py ..............                                                    [ 13%]
tests/test_configure.py ..                                                                   [ 15%]
tests/test_datetimes.py ..............s....................s..........FF..................s  [ 72%]
tests/test_errors.py ..                                                                      [ 74%]
tests/test_import_alias.py ...                                                               [ 76%]
tests/test_operations.py .........                                                           [ 84%]
tests/test_pickle.py ...                                                                     [ 87%]
tests/test_sqlite3.py ..                                                                     [ 88%]
tests/test_ticking.py .s.....                                                                [ 94%]
tests/test_utils.py ..                                                                       [ 96%]
tests/test_uuid.py ..                                                                        [ 98%]
tests/test_warnings.py ..                                                                    [100%]

============================================= FAILURES =============================================
______ TestUnitTestMethodDecorator.test_method_decorator_works_on_unittest_kwarg_frozen_time _______

self = <tests.test_datetimes.TestUnitTestMethodDecorator testMethod=test_method_decorator_works_on_unittest_kwarg_frozen_time>
frozen_time = <freezegun.api.FrozenDateTimeFactory object at 0x7fe66e8a7280>

    @freeze_time('2013-04-09', as_kwarg='frozen_time')
    def test_method_decorator_works_on_unittest_kwarg_frozen_time(self, frozen_time):
        self.assertEqual(datetime.date(2013, 4, 9), datetime.date.today())
>       self.assertEqual(datetime.date(2013, 4, 9), frozen_time.time_to_freeze.today())
E       AssertionError: FakeDate(2013, 4, 9) != datetime.datetime(2013, 4, 8, 19, 0)

tests/test_datetimes.py:523: AssertionError
_________ TestUnitTestMethodDecorator.test_method_decorator_works_on_unittest_kwarg_hello __________

self = <tests.test_datetimes.TestUnitTestMethodDecorator testMethod=test_method_decorator_works_on_unittest_kwarg_hello>
kwargs = {'hello': <freezegun.api.FrozenDateTimeFactory object at 0x7fe66e8ae730>}

    @freeze_time('2013-04-09', as_kwarg='hello')
    def test_method_decorator_works_on_unittest_kwarg_hello(self, **kwargs):
        self.assertEqual(datetime.date(2013, 4, 9), datetime.date.today())
>       self.assertEqual(datetime.date(2013, 4, 9), kwargs.get('hello').time_to_freeze.today())
E       AssertionError: FakeDate(2013, 4, 9) != datetime.datetime(2013, 4, 8, 19, 0)

    def test_method_decorator_works_on_unittest_kwarg_hello(self, **kwargs):
        self.assertEqual(datetime.date(2013, 4, 9), datetime.date.today())
>       self.assertEqual(datetime.date(2013, 4, 9), kwargs.get('hello').time_to_freeze.today())
E       AssertionError: FakeDate(2013, 4, 9) != datetime.datetime(2013, 4, 8, 19, 0)

tests/test_datetimes.py:528: AssertionError

---------- coverage: platform darwin, python 3.8.0-final-0 -----------
Name                    Stmts   Miss  Cover
-------------------------------------------
freezegun/__init__.py       9      0   100%
freezegun/_async.py        10      1    90%
freezegun/api.py          563     62    89%
freezegun/config.py        16      1    94%
-------------------------------------------
TOTAL                     598     64    89%

===================================== short test summary info ======================================
FAILED tests/test_datetimes.py::TestUnitTestMethodDecorator::test_method_decorator_works_on_unittest_kwarg_frozen_time
FAILED tests/test_datetimes.py::TestUnitTestMethodDecorator::test_method_decorator_works_on_unittest_kwarg_hello
============================= 2 failed, 111 passed, 4 skipped in 3.47s =============================
ERROR: InvocationError for command /Users/ted/Development/Repos/freezegun/.tox/py38/bin/pytest --cov (exited with code 1)
pypy3 create: /Users/ted/Development/Repos/freezegun/.tox/pypy3
ERROR: InterpreterNotFound: pypy3
_____________________________________________ summary ______________________________________________
ERROR:  py35: InterpreterNotFound: python3.5
ERROR:  py36: InterpreterNotFound: python3.6
ERROR:  py37: InterpreterNotFound: python3.7
ERROR:   py38: commands failed
ERROR:  pypy3: InterpreterNotFound: pypy3
@boxed
Copy link
Contributor

boxed commented Dec 21, 2020

What time zone are you in?

@tedsilb
Copy link
Author

tedsilb commented Dec 21, 2020

CST. My other test (3.6 on Linux) was in PST. CI is passing (which I assume is UTC), so could be that this test is flaky based on local timezone?

@boxed
Copy link
Contributor

boxed commented Dec 23, 2020

Yea, it's probably the same as #348

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants