aboutsummaryrefslogtreecommitdiffstats
path: root/_pytest
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2020-02-21 01:25:43 +0100
committerTrygve Aaberge <trygveaa@gmail.com>2020-02-21 01:25:43 +0100
commit5682e396c30ab2a65c35e066b441899b9e270800 (patch)
tree97bc6d2bb938cda23c80cc2b4eaf197f7274cfc8 /_pytest
parent395cd5f01d08c4b5ab278ede4baa4c9f15e6e89b (diff)
downloadwee-slack-5682e396c30ab2a65c35e066b441899b9e270800.tar.gz
Fix tests for python 2
Diffstat (limited to '_pytest')
-rw-r--r--_pytest/test_unfurl.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/_pytest/test_unfurl.py b/_pytest/test_unfurl.py
index 13ba392..4aac742 100644
--- a/_pytest/test_unfurl.py
+++ b/_pytest/test_unfurl.py
@@ -2,6 +2,7 @@ from __future__ import print_function, unicode_literals
from datetime import datetime, timedelta
import pytest
+import time
import wee_slack
@@ -121,17 +122,17 @@ import wee_slack
},
{
'input': "Ends <!date^{}^{{date_pretty}} - {{date_short_pretty}} - {{date_long_pretty}}>.".format(
- int((datetime.today()).timestamp())),
+ int(time.mktime(datetime.today().timetuple()))),
'output': "Ends today - today - today."
},
{
'input': "Ends <!date^{}^{{date_pretty}} - {{date_short_pretty}} - {{date_long_pretty}}>.".format(
- int((datetime.today() - timedelta(days=1)).timestamp())),
+ int(time.mktime((datetime.today() - timedelta(days=1)).timetuple()))),
'output': "Ends yesterday - yesterday - yesterday."
},
{
'input': "Ends <!date^{}^{{date_pretty}} - {{date_short_pretty}} - {{date_long_pretty}}>.".format(
- int((datetime.today() + timedelta(days=1)).timestamp())),
+ int(time.mktime((datetime.today() + timedelta(days=1)).timetuple()))),
'output': "Ends tomorrow - tomorrow - tomorrow."
},
{