Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(274813)

Unified Diff: Lib/test/test_time.py

Issue 16510: Using appropriate checks in tests
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Lib/test/test_tempfile.py ('k') | Lib/test/test_traceback.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Lib/test/test_time.py Fri Feb 07 17:53:13 2014 +0100
+++ b/Lib/test/test_time.py Fri Feb 07 23:40:05 2014 +0200
@@ -294,8 +294,8 @@
# on some operating systems (e.g. FreeBSD), which is wrong. See for
# example this bug:
# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=93810
- self.assertIn(time.tzname[0], ('AEST' 'EST'), time.tzname[0])
- self.assertTrue(time.tzname[1] in ('AEDT', 'EDT'), str(time.tzname[1]))
+ self.assertIn(time.tzname[0], ('AEST' 'EST'))
+ self.assertIn(time.tzname[1], ('AEDT', 'EDT'))
self.assertEqual(len(time.tzname), 2)
self.assertEqual(time.daylight, 1)
self.assertEqual(time.timezone, -36000)
@@ -649,11 +649,11 @@
# See if the offset and zone are similar to the module
# attributes.
if lt.tm_gmtoff is None:
- self.assertTrue(not hasattr(time, "timezone"))
+ self.assertFalse(hasattr(time, "timezone"))
else:
self.assertEqual(lt.tm_gmtoff, -[time.timezone, time.altzone][lt.tm_isdst])
if lt.tm_zone is None:
- self.assertTrue(not hasattr(time, "tzname"))
+ self.assertFalse(hasattr(time, "tzname"))
else:
self.assertEqual(lt.tm_zone, time.tzname[lt.tm_isdst])
@@ -688,8 +688,8 @@
# Load a short time structure using pickle.
st = b"ctime\nstruct_time\np0\n((I2007\nI8\nI11\nI1\nI24\nI49\nI5\nI223\nI1\ntp1\n(dp2\ntp3\nRp4\n."
lt = pickle.loads(st)
- self.assertIs(lt.tm_gmtoff, None)
- self.assertIs(lt.tm_zone, None)
+ self.assertIsNone(lt.tm_gmtoff)
+ self.assertIsNone(lt.tm_zone)
if __name__ == "__main__":
« no previous file with comments | « Lib/test/test_tempfile.py ('k') | Lib/test/test_traceback.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+