MCPcopy Index your code
hub / github.com/python/cpython / test_constructors_not_callable

Method test_constructors_not_callable

Lib/test/test_dictviews.py:9–18  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

7class DictSetTest(unittest.TestCase):
8
9 def test_constructors_not_callable(self):
10 kt = type({}.keys())
11 self.assertRaises(TypeError, kt, {})
12 self.assertRaises(TypeError, kt)
13 it = type({}.items())
14 self.assertRaises(TypeError, it, {})
15 self.assertRaises(TypeError, it)
16 vt = type({}.values())
17 self.assertRaises(TypeError, vt, {})
18 self.assertRaises(TypeError, vt)
19
20 def test_dict_keys(self):
21 d = {1: 10, "a": "ABC"}

Callers

nothing calls this directly

Calls 4

keysMethod · 0.45
assertRaisesMethod · 0.45
itemsMethod · 0.45
valuesMethod · 0.45

Tested by

no test coverage detected