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

Method test_genexpr

Lib/test/test_symtable.py:561–569  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

559 self.assertEqual(st.get_children(), [])
560
561 def test_genexpr(self):
562 st = symtable.symtable("(x for x in a)", "?", "exec")
563 self.assertEqual(len(st.get_children()), 1)
564 st = st.get_children()[0]
565 self.assertIs(st.get_type(), symtable.SymbolTableType.FUNCTION)
566 self.assertEqual(st.get_name(), "<genexpr>")
567 self.assertFalse(st.is_nested())
568 self.assertEqual(sorted(st.get_identifiers()), [".0", "x"])
569 self.assertEqual(st.get_children(), [])
570
571 def test_nested_genexpr(self):
572 st = symtable.symtable("((y for y in x) for x in a)", "?", "exec")

Callers

nothing calls this directly

Calls 8

get_typeMethod · 0.80
assertFalseMethod · 0.80
is_nestedMethod · 0.80
assertEqualMethod · 0.45
get_childrenMethod · 0.45
assertIsMethod · 0.45
get_nameMethod · 0.45
get_identifiersMethod · 0.45

Tested by

no test coverage detected