[py-svn] r10694 - py/branch/py-collect/test/testing
hpk at codespeak.net
hpk at codespeak.net
Fri Apr 15 19:13:30 CEST 2005
Author: hpk
Date: Fri Apr 15 19:13:30 2005
New Revision: 10694
Modified:
py/branch/py-collect/test/testing/test_session.py
Log:
add a test for --exec
Modified: py/branch/py-collect/test/testing/test_session.py
==============================================================================
--- py/branch/py-collect/test/testing/test_session.py (original)
+++ py/branch/py-collect/test/testing/test_session.py Fri Apr 15 19:13:30 2005
@@ -146,25 +146,24 @@
class TestRemoteSession:
- def XXXtest_basic(self, method):
- o = tmpdir.ensure('basicremote', dir=1)
- tfile = o.join('test_remote.py')
+ def test_exec(self):
+ o = tmpdir.ensure('remote', dir=1)
+ tfile = o.join('test_exec.py')
tfile.write(py.code.Source("""
def test_1():
assert 1 == 0
"""))
- config, args = py.test.Config.parse(['--looponfailing'])
- assert config._remote
+ print py.std.sys.executable
+ config, args = py.test.Config.parse(
+ ['--exec=' + py.std.sys.executable,
+ str(o)])
+ assert config.option._remote
cls = config.getsessionclass()
- out = py.std.Queue.Queue()
- session = cls(config, out.put)
- pool = WorkerPool()
- reply = pool.dispatch(session.main, [o])
- session.main([o])
- out = self.file.getvalue()
- #print out
- l = []
- self.session = py.test.TerminalSession(config, file=self.file)
- #print >>f, "session %r is setup for %r" %(self.session, method)
- #f.flush()
- #print "session is setup", self.session
+ out = [] # out = py.std.Queue.Queue()
+ session = cls(config, out.append)
+ session.main([o])
+ for s in out:
+ if s.find('1 failed') != -1:
+ break
+ else:
+ py.test.fail("did not see test_1 failure")
More information about the pytest-commit
mailing list