-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Guard against obscure bug in test setup
If you try to freeze time to before 2011 you get the following obscure exception from somewhere within itsdangerous: ``` timestamp = base64_encode(int_to_bytes(self.get_timestamp())) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ num = -1 def int_to_bytes(num): > assert num >= 0 E AssertionError ``` Something in there is baselining `timestamp` to `0` at the start of 2011. Which means that trying to freeze time to before then results in a negative timestamp. This is a very non-obvious exception to see, so hopefully raising a specific exception instead will save others some time.
- Loading branch information
Showing
2 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters