diff --git a/CHANGELOG b/CHANGELOG index b40c84bf9..4e4ee0a80 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,8 @@ Changes between 2.0.0 and 2.0.1.devX ---------------------------------------------- +- remove somewhat surprising "same-conftest" detection because + it ignores conftest.py when they appear in several subdirs. - improve assertions ("not in"), thanks Floris - improve behaviour/warnings when running on top of "python -OO" (assertions and docstrings are turned off, leading to potential diff --git a/_pytest/config.py b/_pytest/config.py index 65b6d4100..b62e222df 100644 --- a/_pytest/config.py +++ b/_pytest/config.py @@ -125,7 +125,6 @@ class Conftest(object): self._onimport = onimport self._conftestpath2mod = {} self._confcutdir = confcutdir - self._md5cache = {} def setinitial(self, args): """ try to find a first anchor path for looking up global values @@ -179,14 +178,7 @@ class Conftest(object): else: conftestpath = path.join("conftest.py") if conftestpath.check(file=1): - key = conftestpath.computehash() - # XXX logging about conftest loading - if key not in self._md5cache: - clist.append(self.importconftest(conftestpath)) - self._md5cache[key] = conftestpath - else: - # use some kind of logging - print ("WARN: not loading %s" % conftestpath) + clist.append(self.importconftest(conftestpath)) clist[:0] = self.getconftestmodules(dp) self._path2confmods[path] = clist # be defensive: avoid changes from caller side to diff --git a/testing/test_conftest.py b/testing/test_conftest.py index e25b68abf..23824be57 100644 --- a/testing/test_conftest.py +++ b/testing/test_conftest.py @@ -170,21 +170,6 @@ def test_setinitial_confcut(testdir): assert conftest.getconftestmodules(sub) == [] assert conftest.getconftestmodules(conf.dirpath()) == [] -def test_conftest_samecontent_detection(testdir): - conf = testdir.makeconftest("x=3") - p = testdir.mkdir("x") - conf.copy(p.join("conftest.py")) - conftest = Conftest() - conftest.setinitial([p]) - l = conftest.getconftestmodules(p) - assert len(l) == 1 - assert l[0].__file__ == p.join("conftest.py") - p2 = p.mkdir("y") - conf.copy(p2.join("conftest.py")) - l = conftest.getconftestmodules(p2) - assert len(l) == 1 - assert l[0].__file__ == p.join("conftest.py") - @pytest.mark.multi(name='test tests whatever .dotdir'.split()) def test_setinitial_conftest_subdirs(testdir, name): sub = testdir.mkdir(name)