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

Method test_sets

Lib/test/test_gdb/test_pretty_print.py:168–184  ·  view source on GitHub ↗

Verify the pretty-printing of sets

(self)

Source from the content-addressed store, hash-verified

166
167 @support.requires_resource('cpu')
168 def test_sets(self):
169 'Verify the pretty-printing of sets'
170 if GDB_VERSION < (7, 3):
171 self.skipTest("pretty-printing of sets needs gdb 7.3 or later")
172 self.assertGdbRepr(set(), "set()")
173 self.assertGdbRepr(set(['a']), "{'a'}")
174 # PYTHONHASHSEED is need to get the exact frozenset item order
175 if not sys.flags.ignore_environment:
176 self.assertGdbRepr(set(['a', 'b']), "{'a', 'b'}")
177 self.assertGdbRepr(set([4, 5, 6]), "{4, 5, 6}")
178
179 # Ensure that we handle sets containing the "dummy" key value,
180 # which happens on deletion:
181 gdb_repr, gdb_output = self.get_gdb_repr('''s = set(['a','b&#x27;])
182s.remove('a')
183id(s)''&#x27;)
184 self.assertEqual(gdb_repr, "{'b'}")
185
186 @support.requires_resource('cpu')
187 def test_frozensets(self):

Callers

nothing calls this directly

Calls 5

assertGdbReprMethod · 0.95
get_gdb_reprMethod · 0.95
setFunction · 0.85
skipTestMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected