-
-
Notifications
You must be signed in to change notification settings - Fork 275
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
Mock time to make date-based tests reliable #394
Conversation
Codecov Report
@@ Coverage Diff @@
## master #394 +/- ##
======================================
Coverage 84.8% 84.8%
======================================
Files 6 6
Lines 849 849
Branches 129 129
======================================
Hits 720 720
Misses 87 87
Partials 42 42 Continue to review full report at Codecov.
|
tests/functional/test_httplib2.py
Outdated
@@ -64,10 +66,11 @@ def test_httpretty_provides_easy_access_to_querystrings(now): | |||
|
|||
|
|||
@httprettified | |||
@within(two=microseconds) | |||
def test_httpretty_should_mock_headers_httplib2(now): | |||
@patch('httpretty.core.datetime') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this would be better with freezegun
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Use mocked clock when running tests involving checking the 'Date' header. These tests used system clock so far which caused frequent test failures if the check occurred in the second following generating the response. Fixes gabrielfalcao#376
Ping. |
great job! |
Use mocked clock when running tests involving checking the 'Date'
header. These tests used system clock so far which caused frequent
test failures if the check occurred in the second following generating
the response.
Fixes #376