Commits

longlho committed 395084b

make sure --clearcache still works with .cache folder non-existent. Also remove pep8 from test since it causes circular dependency in the test

Comments (0)

Files changed (4)

 \.tox
 .history
 .cache
+.idea
         self.trace = config.trace.root.get("cache")
         if config.getvalue("clearcache"):
             self.trace("clearing cachedir")
-            self._cachedir.remove()
+            if self._cachedir.check():
+                self._cachedir.remove()
             self._cachedir.mkdir()
 
     def makedir(self, name):
+import os
 import pytest
+import shutil
 import py
-from textwrap import dedent
 
 pytest_plugins = "pytester",
 
             "*1 failed*2 passed*",
         ])
 
+        # Run this again to make sure clearcache is robust
+        if os.path.isdir('.cache'):
+            shutil.rmtree('.cache')
+        result = testdir.runpytest("--lf", "--clearcache")
+        result.stdout.fnmatch_lines([
+            "*1 failed*2 passed*",
+        ])
+
     @pytest.mark.skipif("sys.version_info < (2,6)")
     def test_lastfailed_difference_invocations(self, testdir, monkeypatch):
         monkeypatch.setenv("PYTHONDONTWRITEBYTECODE", 1)
     pypi = http://pypi.python.org/simple
 
 [testenv]
-deps=:pypi:pep8
-     :pypi:pytest-pep8
 
 commands =
-    py.test --pep8 --junitxml={envlogdir}/junit-{envname}.xml {posargs}
+    py.test --junitxml={envlogdir}/junit-{envname}.xml {posargs}
 
 [testenv:py-xdist]
 deps={[testenv]deps}
     pytest-xdist
 commands =
-    py.test --pep8 -n3 --junitxml={envlogdir}/junit-{envname}.xml {posargs}
+    py.test -n3 --junitxml={envlogdir}/junit-{envname}.xml {posargs}
 
 [pytest]
 pep8ignore = E128 E302
     doc/conf.py ALL
-addopts = --pep8