summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorYesung(Isaac) Lee <yy0221ss@gmail.com>2022-12-11 23:44:29 (GMT)
committerGitHub <noreply@github.com>2022-12-11 23:44:29 (GMT)
commit54289f85b2af1ecf046089ddf535dda1bdf6af24 (patch)
tree1399c50a7b838d4c14f0cd05d5d8b3cf25bcc3fc /Lib/test
parent868bab0fdc514cfa70ce97e484a689aee8cb5a36 (diff)
downloadcpython-54289f85b2af1ecf046089ddf535dda1bdf6af24.zip
cpython-54289f85b2af1ecf046089ddf535dda1bdf6af24.tar.gz
cpython-54289f85b2af1ecf046089ddf535dda1bdf6af24.tar.bz2
gh-99688: Fix outdated tests in test_unary (#99712)
* Remove duplicates from "L" suffix removal * test_invert now tests `~`.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_unary.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/Lib/test/test_unary.py b/Lib/test/test_unary.py
index c3c17cc..a45fbf6 100644
--- a/Lib/test/test_unary.py
+++ b/Lib/test/test_unary.py
@@ -8,7 +8,6 @@ class UnaryOpTestCase(unittest.TestCase):
self.assertTrue(-2 == 0 - 2)
self.assertEqual(-0, 0)
self.assertEqual(--2, 2)
- self.assertTrue(-2 == 0 - 2)
self.assertTrue(-2.0 == 0 - 2.0)
self.assertTrue(-2j == 0 - 2j)
@@ -16,15 +15,13 @@ class UnaryOpTestCase(unittest.TestCase):
self.assertEqual(+2, 2)
self.assertEqual(+0, 0)
self.assertEqual(++2, 2)
- self.assertEqual(+2, 2)
self.assertEqual(+2.0, 2.0)
self.assertEqual(+2j, 2j)
def test_invert(self):
- self.assertTrue(-2 == 0 - 2)
- self.assertEqual(-0, 0)
- self.assertEqual(--2, 2)
- self.assertTrue(-2 == 0 - 2)
+ self.assertTrue(~2 == -(2+1))
+ self.assertEqual(~0, -1)
+ self.assertEqual(~~2, 2)
def test_no_overflow(self):
nines = "9" * 32