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

Method test_buggy_dir

Lib/test/test_pydoc/test_pydoc.py:2288–2299  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2286 'trace function introduces __locals__ unexpectedly')
2287 @requires_docstrings
2288 def test_buggy_dir(self):
2289 class M(type):
2290 def __dir__(cls):
2291 return ['__class__', '__name__', 'missing', 'here']
2292 class C(metaclass=M):
2293 here = 'present!'
2294 output = StringIO()
2295 helper = pydoc.Helper(output=output)
2296 helper(C)
2297 expected_text = expected_missingattribute_pattern % __name__
2298 result = output.getvalue().strip()
2299 self.assertEqual(expected_text, result)
2300
2301 def test_resolve_false(self):
2302 # Issue #23008: pydoc enum.{,Int}Enum failed

Callers

nothing calls this directly

Calls 5

getvalueMethod · 0.95
StringIOClass · 0.90
helperFunction · 0.50
stripMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected