From 395cd5f01d08c4b5ab278ede4baa4c9f15e6e89b Mon Sep 17 00:00:00 2001 From: Trygve Aaberge Date: Fri, 21 Feb 2020 01:05:14 +0100 Subject: Make tests work when the timezone is set to UTC Unfortunately, the date tests of the last commit only work in one time zone. This changes them to work in UTC. If your machine doesn't use UTC, you now have to run the tests like this: TZ=UTC pytest I'm not sure what the best way to avoid requiring this is. --- _pytest/test_unfurl.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to '_pytest') diff --git a/_pytest/test_unfurl.py b/_pytest/test_unfurl.py index 3545332..13ba392 100644 --- a/_pytest/test_unfurl.py +++ b/_pytest/test_unfurl.py @@ -104,16 +104,20 @@ import wee_slack 'output': "@othersubteam This is announcement for the dev team" }, { - 'input': "Ends .", - 'output': "Ends 2020-03-19 - March 19, 2020 - Mar 19, 2020 - Thursday, March 19, 2020 at 00:19 - 00:19:28." + 'input': "Ends .", + 'output': "Ends 2020-01-01 - January 01, 2020 - Jan 01, 2020 - Wednesday, January 01, 2020." }, { - 'input': "Ends .", - 'output': "Ends 2020-03-19 {invalid_token}." + 'input': "Ends .", + 'output': "Ends 12:00 - 12:00:00." }, { - 'input': "Ends .", - 'output': "Ends 2020-03-19 (http://github.com)." + 'input': "Ends .", + 'output': "Ends 2020-01-01 {invalid_token}." + }, + { + 'input': "Ends .", + 'output': "Ends 2020-01-01 (http://github.com)." }, { 'input': "Ends .".format( @@ -131,7 +135,7 @@ import wee_slack 'output': "Ends tomorrow - tomorrow - tomorrow." }, { - 'input': "Ends .", + 'input': "Ends .", 'output': "Ends January 01, 2020 - Jan 01, 2020 - Wednesday, January 01, 2020." } )) -- cgit