mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
add annotations for making test success
Signed-off-by: snowapril <sinjihng@gmail.com>
This commit is contained in:
1 parent
4016eb95af
commit
98f2f871cd
1 file changed
+17
Vendored
+17
@@ -6,6 +6,8 @@ import unittest
|
||||
|
||||
class DictSetTest(unittest.TestCase):
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_constructors_not_callable(self):
|
||||
kt = type({}.keys())
|
||||
self.assertRaises(TypeError, kt, {})
|
||||
@@ -17,6 +19,8 @@ class DictSetTest(unittest.TestCase):
|
||||
self.assertRaises(TypeError, vt, {})
|
||||
self.assertRaises(TypeError, vt)
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_dict_keys(self):
|
||||
d = {1: 10, "a": "ABC"}
|
||||
keys = d.keys()
|
||||
@@ -37,6 +41,8 @@ class DictSetTest(unittest.TestCase):
|
||||
del e["a"]
|
||||
self.assertNotEqual(d.keys(), e.keys())
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_dict_items(self):
|
||||
d = {1: 10, "a": "ABC"}
|
||||
items = d.items()
|
||||
@@ -60,6 +66,8 @@ class DictSetTest(unittest.TestCase):
|
||||
e["a"] = "def"
|
||||
self.assertNotEqual(d.items(), e.items())
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_dict_mixed_keys_items(self):
|
||||
d = {(1, 1): 11, (2, 2): 22}
|
||||
e = {1: 1, 2: 2}
|
||||
@@ -72,6 +80,7 @@ class DictSetTest(unittest.TestCase):
|
||||
self.assertEqual(set(values), {10, "ABC"})
|
||||
self.assertEqual(len(values), 2)
|
||||
|
||||
@unittest.skip("TODO: RUSTPYTHON, TypeError: '&' not supported between instances of 'dict_keys' and 'dict_keys'")
|
||||
def test_dict_repr(self):
|
||||
d = {1: 10, "a": "ABC"}
|
||||
self.assertIsInstance(repr(d), str)
|
||||
@@ -88,6 +97,7 @@ class DictSetTest(unittest.TestCase):
|
||||
self.assertTrue(r == "dict_values(['ABC', 10])" or
|
||||
r == "dict_values([10, 'ABC'])")
|
||||
|
||||
@unittest.skip("TODO: RUSTPYTHON, TypeError: '&' not supported between instances of 'dict_items' and 'dict_items'")
|
||||
def test_keys_set_operations(self):
|
||||
d1 = {'a': 1, 'b': 2}
|
||||
d2 = {'b': 3, 'c': 2}
|
||||
@@ -144,6 +154,7 @@ class DictSetTest(unittest.TestCase):
|
||||
self.assertTrue(de.keys().isdisjoint(de.keys()))
|
||||
self.assertTrue(de.keys().isdisjoint([1]))
|
||||
|
||||
@unittest.skip("TODO: RUSTPYTHON, TypeError: '&' not supported between instances of 'dict_items' and 'dict_items'")
|
||||
def test_items_set_operations(self):
|
||||
d1 = {'a': 1, 'b': 2}
|
||||
d2 = {'a': 2, 'b': 2}
|
||||
@@ -213,18 +224,24 @@ class DictSetTest(unittest.TestCase):
|
||||
# Again.
|
||||
self.assertIsInstance(r, str)
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
@unittest.skipIf(sys.platform == "win32", "thread 'main' has overflowed its stack")
|
||||
def test_deeply_nested_repr(self):
|
||||
d = {}
|
||||
for i in range(sys.getrecursionlimit() + 100):
|
||||
d = {42: d.values()}
|
||||
self.assertRaises(RecursionError, repr, d)
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_copy(self):
|
||||
d = {1: 10, "a": "ABC"}
|
||||
self.assertRaises(TypeError, copy.copy, d.keys())
|
||||
self.assertRaises(TypeError, copy.copy, d.values())
|
||||
self.assertRaises(TypeError, copy.copy, d.items())
|
||||
|
||||
@unittest.skip("TODO: RUSTPYTHON, DictSetTest.test_compare_error.<locals>.Exc")
|
||||
def test_compare_error(self):
|
||||
class Exc(Exception):
|
||||
pass
|
||||
|
||||
Reference in new issue
Block a user