Merge pull request #4224 from blueyed/_getconftestmodules

_getconftestmodules: avoid isfile()/dirpath()
This commit is contained in:
Daniel Hahler 2018-10-26 14:44:46 +02:00 committed by GitHub
commit 9cde67c09c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 6 deletions

View File

@ -387,13 +387,13 @@ class PytestPluginManager(PluginManager):
if self._noconftest:
return []
if path.isfile():
directory = path.dirpath()
else:
directory = path
try:
return self._path2confmods[directory]
return self._path2confmods[path]
except KeyError:
if path.isfile():
directory = path.dirpath()
else:
directory = path
# XXX these days we may rather want to use config.rootdir
# and allow users to opt into looking into the rootdir parent
# directories instead of requiring to specify confcutdir
@ -406,7 +406,7 @@ class PytestPluginManager(PluginManager):
mod = self._importconftest(conftestpath)
clist.append(mod)
self._path2confmods[directory] = clist
self._path2confmods[path] = clist
return clist
def _rget_with_confmod(self, name, path):