holger krekel avatar holger krekel committed 8150396

fix tests by properly removing __pycache__ files

Comments (0)

Files changed (2)

     packages = ['xdist'],
     entry_points = {'pytest11': ['xdist = xdist.plugin'],},
     zip_safe=False,
-    install_requires = ['execnet>=1.0.8', 'pytest>=2.2.1.dev2'],
+    install_requires = ['execnet>=1.0.8', 'pytest>=2.2.1.dev5'],
     classifiers=[
     'Development Status :: 5 - Production/Stable',
     'Intended Audience :: Developers',

testing/test_looponfail.py

         assert not failures
 
     def test_failures_somewhere(self, testdir):
-        item = testdir.getitem("def test_func(): assert 0\n")
+        item = testdir.getitem("def test_func():\n assert 0\n")
         control = RemoteControl(item.config)
         control.setup()
         failures = control.runsession()
         assert failures
         control.setup()
-        item.fspath.write("def test_func(): assert 1\n")
-        pyc = item.fspath.new(ext=".pyc")
-        if pyc.check():
-            pyc.remove()
+        item.fspath.write("def test_func():\n assert 1\n")
+        removepyc(item.fspath)
         topdir, failures = control.runsession()[:2]
         assert not failures
 
             def test_new():
                 assert 0
         """))
-        pyc = modcol.fspath.new(ext=".pyc")
-        if pyc.check():
-            pyc.remove()
+        removepyc(modcol.fspath)
         control.loop_once()
         assert not control.failures
         control.loop_once()
     pyc = path + "c"
     if pyc.check():
         pyc.remove()
+    c = path.dirpath("__pycache__")
+    if c.check():
+        c.remove()
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.