fix tests by properly removing __pycache__ files
This commit is contained in:
2
setup.py
2
setup.py
@@ -13,7 +13,7 @@ setup(
|
|||||||
packages = ['xdist'],
|
packages = ['xdist'],
|
||||||
entry_points = {'pytest11': ['xdist = xdist.plugin'],},
|
entry_points = {'pytest11': ['xdist = xdist.plugin'],},
|
||||||
zip_safe=False,
|
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=[
|
classifiers=[
|
||||||
'Development Status :: 5 - Production/Stable',
|
'Development Status :: 5 - Production/Stable',
|
||||||
'Intended Audience :: Developers',
|
'Intended Audience :: Developers',
|
||||||
|
|||||||
@@ -88,16 +88,14 @@ class TestRemoteControl:
|
|||||||
assert not failures
|
assert not failures
|
||||||
|
|
||||||
def test_failures_somewhere(self, testdir):
|
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 = RemoteControl(item.config)
|
||||||
control.setup()
|
control.setup()
|
||||||
failures = control.runsession()
|
failures = control.runsession()
|
||||||
assert failures
|
assert failures
|
||||||
control.setup()
|
control.setup()
|
||||||
item.fspath.write("def test_func(): assert 1\n")
|
item.fspath.write("def test_func():\n assert 1\n")
|
||||||
pyc = item.fspath.new(ext=".pyc")
|
removepyc(item.fspath)
|
||||||
if pyc.check():
|
|
||||||
pyc.remove()
|
|
||||||
topdir, failures = control.runsession()[:2]
|
topdir, failures = control.runsession()[:2]
|
||||||
assert not failures
|
assert not failures
|
||||||
|
|
||||||
@@ -115,9 +113,7 @@ class TestRemoteControl:
|
|||||||
def test_new():
|
def test_new():
|
||||||
assert 0
|
assert 0
|
||||||
"""))
|
"""))
|
||||||
pyc = modcol.fspath.new(ext=".pyc")
|
removepyc(modcol.fspath)
|
||||||
if pyc.check():
|
|
||||||
pyc.remove()
|
|
||||||
control.loop_once()
|
control.loop_once()
|
||||||
assert not control.failures
|
assert not control.failures
|
||||||
control.loop_once()
|
control.loop_once()
|
||||||
@@ -252,4 +248,7 @@ def removepyc(path):
|
|||||||
pyc = path + "c"
|
pyc = path + "c"
|
||||||
if pyc.check():
|
if pyc.check():
|
||||||
pyc.remove()
|
pyc.remove()
|
||||||
|
c = path.dirpath("__pycache__")
|
||||||
|
if c.check():
|
||||||
|
c.remove()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user