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

Method test_5

Lib/test/test_pkg.py:183–209  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

181 self.run_code(s)
182
183 def test_5(self):
184 hier = [
185 ("t5", None),
186 ("t5 __init__.py", "import t5.foo"),
187 ("t5 string.py", "spam = 1"),
188 ("t5 foo.py",
189 "from . import string; assert string.spam == 1"),
190 ]
191 self.mkhier(hier)
192
193 s = """
194 from t5 import *
195 self.assertEqual(dir(), ['foo', 'self', 'string', 't5'])
196 """
197 self.run_code(s)
198
199 import t5
200 self.assertEqual(fixdir(dir(t5)),
201 ['__doc__', '__file__', '__loader__', '__name__',
202 '__package__', '__path__', '__spec__', 'foo',
203 'string', 't5'])
204 self.assertEqual(fixdir(dir(t5.foo)),
205 ['__doc__', '__file__', '__loader__', '__name__',
206 '__package__', '__spec__', 'string'])
207 self.assertEqual(fixdir(dir(t5.string)),
208 ['__doc__', '__file__', '__loader__', '__name__',
209 '__package__', '__spec__', 'spam'])
210
211 def test_6(self):
212 hier = [

Callers

nothing calls this directly

Calls 4

mkhierMethod · 0.95
run_codeMethod · 0.95
fixdirFunction · 0.85
assertEqualMethod · 0.45

Tested by

no test coverage detected