jenkins-bot merged this change.

View Change

Approvals: Dvorapa: Looks good to me, approved jenkins-bot: Verified
[tests] Show additional information with test_expired

Bug: T244982
Change-Id: Ib93546a5d0b41a024e95bb0e1cbd88b1bf174c8c
---
M tests/dry_api_tests.py
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/tests/dry_api_tests.py b/tests/dry_api_tests.py
index 4d29f85..9e61e60 100644
--- a/tests/dry_api_tests.py
+++ b/tests/dry_api_tests.py
@@ -74,9 +74,11 @@

def test_expired(self):
"""Test if the request is expired."""
- self.assertFalse(self.req._expired(datetime.datetime.utcnow()))
- self.assertTrue(self.req._expired(
- datetime.datetime.utcnow() - datetime.timedelta(days=2)))
+ now = datetime.datetime.utcnow()
+ self.assertFalse(self.req._expired(now))
+ self.assertTrue(
+ self.req._expired(now - datetime.timedelta(days=2)),
+ msg='\nreq.expiry: {}, now: {}'.format(self.req.expiry, now))

def test_parameter_types(self):
"""Test _uniquedescriptionstr is identical using different ways."""

To view, visit change 592480. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ib93546a5d0b41a024e95bb0e1cbd88b1bf174c8c
Gerrit-Change-Number: 592480
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: Dvorapa <dvorapa@seznam.cz>
Gerrit-Reviewer: jenkins-bot (75)