Verify the pretty-printing of sets
(self)
| 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']) |
| 182 | s.remove('a') |
| 183 | id(s)''') |
| 184 | self.assertEqual(gdb_repr, "{'b'}") |
| 185 | |
| 186 | @support.requires_resource('cpu') |
| 187 | def test_frozensets(self): |
nothing calls this directly
no test coverage detected