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

Freezegun does not affect time.strftime #76

Closed
calpaterson opened this issue Jan 28, 2015 · 3 comments
Closed

Freezegun does not affect time.strftime #76

calpaterson opened this issue Jan 28, 2015 · 3 comments

Comments

@calpaterson
Copy link

Freezegun doesn't affect time.strptime, which still returns the current time. I know you don't claim to affect this method in the README, but it might but helpful to others if you could mention explicitly that you don't:

import unittest
import time

from freezegun import freeze_time

class TestStrptime(unittest.TestCase):

    @freeze_time("2012-01-14 12:00:01")
    def test_strptime(self):
        self.assertEquals(time.strftime("%Y"), "2012")
@spulec
Copy link
Owner

spulec commented Feb 4, 2015

Ah, I missed one!

Thanks for opening. I'll try to get around to fixing this. If anyone else gets a minute and wants to take a stab at a pull request, feel free.

@spulec
Copy link
Owner

spulec commented Feb 7, 2015

I've added support for time.strftime, time.localtime, and time.gmtime with #78.

If you can give it a test on your end, I'll update the docs and push out a new release.

@spulec
Copy link
Owner

spulec commented Feb 16, 2015

Pushing out a new release now. Feel free to reopen if things don't seem to work.

@spulec spulec closed this as completed Feb 16, 2015
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