Fix docs formatting and improve test a bit

This commit is contained in:
Bruno Oliveira 2018-08-10 18:18:07 -03:00
parent 50db718a6a
commit 27b5435a40
1 changed files with 7 additions and 4 deletions

View File

@ -639,9 +639,9 @@ class Test_getinitialnodes(object):
def test_pkgfile(self, testdir):
"""Verify nesting when a module is within a package.
The parent chain should match: Module<x.py> -> Package<subdir> -> Session.
Session's parent should always be None.
"""
The parent chain should match: Module<x.py> -> Package<subdir> -> Session.
Session's parent should always be None.
"""
tmpdir = testdir.tmpdir
subdir = tmpdir.join("subdir")
x = subdir.ensure("x.py")
@ -649,8 +649,11 @@ class Test_getinitialnodes(object):
with subdir.as_cwd():
config = testdir.parseconfigure(x)
col = testdir.getnode(config, x)
assert isinstance(col, pytest.Module)
assert col.name == "x.py"
assert isinstance(col, pytest.Module)
assert isinstance(col.parent, pytest.Package)
assert isinstance(col.parent.parent, pytest.Session)
# session is batman (has no parents)
assert col.parent.parent.parent is None
for col in col.listchain():
assert col.config is config