jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/592480 )
Change subject: [tests] Show additional information with test_expired ......................................................................
[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(-)
Approvals: Dvorapa: Looks good to me, approved jenkins-bot: Verified
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."""
pywikibot-commits@lists.wikimedia.org