Clean up Package.__init__
Makes `parent` a required arg, which would have failed before via `parent.session` anyway. Keeps calling/passing unused args for B/C.
This commit is contained in:
parent
9b8039cf09
commit
817c094ce6
|
@ -545,15 +545,23 @@ class Module(nodes.File, PyCollector):
|
||||||
|
|
||||||
|
|
||||||
class Package(Module):
|
class Package(Module):
|
||||||
def __init__(self, fspath, parent=None, config=None, session=None, nodeid=None):
|
def __init__(
|
||||||
|
self,
|
||||||
|
fspath: py.path.local,
|
||||||
|
parent: nodes.Collector,
|
||||||
|
# NOTE: following args are unused:
|
||||||
|
config=None,
|
||||||
|
session=None,
|
||||||
|
nodeid=None,
|
||||||
|
) -> None:
|
||||||
|
# NOTE: could be just the following, but kept as-is for compat.
|
||||||
|
# nodes.FSCollector.__init__(self, fspath, parent=parent)
|
||||||
session = parent.session
|
session = parent.session
|
||||||
nodes.FSCollector.__init__(
|
nodes.FSCollector.__init__(
|
||||||
self, fspath, parent=parent, config=config, session=session, nodeid=nodeid
|
self, fspath, parent=parent, config=config, session=session, nodeid=nodeid
|
||||||
)
|
)
|
||||||
|
|
||||||
self.name = fspath.dirname
|
self.name = fspath.dirname
|
||||||
self.trace = session.trace
|
|
||||||
self._norecursepatterns = session._norecursepatterns
|
|
||||||
self.fspath = fspath
|
|
||||||
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
# not using fixtures to call setup_module here because autouse fixtures
|
# not using fixtures to call setup_module here because autouse fixtures
|
||||||
|
|
Loading…
Reference in New Issue