FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Update test_compare from Cpython v3.11.2 by Masorubka1 · Pull Request #4803 · RustPython/RustPython · GitHub

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
16 changes: 5 additions & 11 deletions Lib/test/test_compare.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import unittest
from test.support import ALWAYS_EQ

class Empty:
def __repr__(self):
Expand All @@ -14,13 +15,6 @@ def __repr__(self):
def __eq__(self, other):
return self.arg == other

class Anything:
def __eq__(self, other):
return True

def __ne__(self, other):
return False

class ComparisonTest(unittest.TestCase):
set1 = [2, 2.0, 2, 2+0j, Cmp(2.0)]
set2 = [[1], (3,), None, Empty()]
Expand Down Expand Up @@ -113,11 +107,11 @@ class C:

def test_issue_1393(self):
x = lambda: None
self.assertEqual(x, Anything())
self.assertEqual(Anything(), x)
self.assertEqual(x, ALWAYS_EQ)
self.assertEqual(ALWAYS_EQ, x)
y = object()
self.assertEqual(y, Anything())
self.assertEqual(Anything(), y)
self.assertEqual(y, ALWAYS_EQ)
self.assertEqual(ALWAYS_EQ, y)


if __name__ == '__main__':
Expand Down

Back | FazBrowse Home | New Git URL