MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_vars

Method test_vars

Lib/test/test_builtin.py:2083–2090  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2081 __dict__ = property(fget=getDict)
2082
2083 def test_vars(self):
2084 self.assertEqual(set(vars()), set(dir()))
2085 self.assertEqual(set(vars(sys)), set(dir(sys)))
2086 self.assertEqual(self.get_vars_f0(), {})
2087 self.assertEqual(self.get_vars_f2(), {'a': 1, 'b': 2})
2088 self.assertRaises(TypeError, vars, 42, 42)
2089 self.assertRaises(TypeError, vars, 42)
2090 self.assertEqual(vars(self.C_get_vars()), {'a':2})
2091
2092 def iter_error(self, iterable, error):
2093 """Collect `iterable` into a list, catching an expected `error`."""

Callers

nothing calls this directly

Calls 7

get_vars_f0Method · 0.95
get_vars_f2Method · 0.95
setFunction · 0.85
varsFunction · 0.85
dirFunction · 0.85
assertEqualMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected