Skip to content

Instantly share code, notes, and snippets.

@PuercoPop
Created February 6, 2013 17:29
Show Gist options
  • Save PuercoPop/4724228 to your computer and use it in GitHub Desktop.
Save PuercoPop/4724228 to your computer and use it in GitHub Desktop.
Test case for freezegun that fails
# -*- coding: utf-8 -*-
# To run py.test test.py
from datetime import datetime
from freezegun import freeze_time
class A(object):
def __init__(self):
self.date = datetime.now()
def test_():
with freeze_time("1990-01-01 18:00:00"):
a = A()
assert a.date.year == 1990
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment