summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_struct.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/Lib/test/test_struct.py b/Lib/test/test_struct.py
index 3d67abd..2222562 100644
--- a/Lib/test/test_struct.py
+++ b/Lib/test/test_struct.py
@@ -164,14 +164,14 @@ class StructTest(unittest.TestCase):
self.assertEqual(signed_size, unsigned_size)
# bounds for native integer sizes
- self.assertTrue(struct.calcsize('b')==1)
- self.assertTrue(2 <= struct.calcsize('h'))
- self.assertTrue(4 <= struct.calcsize('l'))
- self.assertTrue(struct.calcsize('h') <= struct.calcsize('i'))
- self.assertTrue(struct.calcsize('i') <= struct.calcsize('l'))
+ self.assertEqual(struct.calcsize('b'), 1)
+ self.assertLessEqual(2, struct.calcsize('h'))
+ self.assertLessEqual(4, struct.calcsize('l'))
+ self.assertLessEqual(struct.calcsize('h'), struct.calcsize('i'))
+ self.assertLessEqual(struct.calcsize('i'), struct.calcsize('l'))
if HAVE_LONG_LONG:
- self.assertTrue(8 <= struct.calcsize('q'))
- self.assertTrue(struct.calcsize('l') <= struct.calcsize('q'))
+ self.assertLessEqual(8, struct.calcsize('q'))
+ self.assertLessEqual(struct.calcsize('l'), struct.calcsize('q'))
def test_integers(self):
# Integer tests (bBhHiIlLqQ).
@@ -209,7 +209,7 @@ class StructTest(unittest.TestCase):
expected = x
if self.signed and x < 0:
expected += 1 << self.bitsize
- self.assertTrue(expected >= 0)
+ self.assertGreaterEqual(expected, 0)
expected = '%x' % expected
if len(expected) & 1:
expected = "0" + expected