Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Checkins
cpython: don't use assertEqual for test for bool equality
 

Index | Next | Previous | View Flat


python-checkins at python

May 1, 2012, 8:14 AM


Views: 42
Permalink
cpython: don't use assertEqual for test for bool equality

http://hg.python.org/cpython/rev/bec267540811
changeset: 76700:bec267540811
parent: 76697:e1a200dfd5db
user: Benjamin Peterson <benjamin [at] python>
date: Tue May 01 11:14:32 2012 -0400
summary:
don't use assertEqual for test for bool equality

files:
Lib/test/test_time.py | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)


diff --git a/Lib/test/test_time.py b/Lib/test/test_time.py
--- a/Lib/test/test_time.py
+++ b/Lib/test/test_time.py
@@ -30,16 +30,16 @@
def test_time(self):
time.time()
info = time.get_clock_info('time')
- self.assertEqual(info.monotonic, False)
+ self.assertFalse(info.monotonic)
if sys.platform != 'win32':
- self.assertEqual(info.adjusted, True)
+ self.assertTrue(info.adjusted)

def test_clock(self):
time.clock()

info = time.get_clock_info('clock')
- self.assertEqual(info.monotonic, True)
- self.assertEqual(info.adjusted, False)
+ self.assertTrue(info.monotonic)
+ self.assertFalse(info.adjusted)

@unittest.skipUnless(hasattr(time, 'clock_gettime'),
'need time.clock_gettime()')
@@ -370,11 +370,11 @@
self.assertAlmostEqual(dt, 0.1, delta=0.2)

info = time.get_clock_info('monotonic')
- self.assertEqual(info.monotonic, True)
+ self.assertTrue(info.monotonic)
if sys.platform == 'linux':
- self.assertEqual(info.adjusted, True)
+ self.assertTrue(info.adjusted)
else:
- self.assertEqual(info.adjusted, False)
+ self.assertFalse(info.adjusted)

def test_perf_counter(self):
time.perf_counter()
@@ -386,8 +386,8 @@
self.assertLess(stop - start, 0.01)

info = time.get_clock_info('process_time')
- self.assertEqual(info.monotonic, True)
- self.assertEqual(info.adjusted, False)
+ self.assertTrue(info.monotonic)
+ self.assertFalse(info.adjusted)

@unittest.skipUnless(hasattr(time, 'monotonic'),
'need time.monotonic')

--
Repository URL: http://hg.python.org/cpython

Subject User Time
cpython: don't use assertEqual for test for bool equality python-checkins at python May 1, 2012, 8:14 AM

  Index | Next | Previous | View Flat
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.