[py-svn] r36338 - in py/dist/py: . test/rsession test/rsession/testing
fijal at codespeak.net
fijal at codespeak.net
Tue Jan 9 13:03:56 CET 2007
Author: fijal
Date: Tue Jan 9 13:03:45 2007
New Revision: 36338
Modified:
py/dist/py/__init__.py
py/dist/py/test/rsession/box.py
py/dist/py/test/rsession/outcome.py
py/dist/py/test/rsession/rsession.py
py/dist/py/test/rsession/slave.py
py/dist/py/test/rsession/testing/test_rsession.py
py/dist/py/test/rsession/testing/test_slave.py
Log:
Cleanup a bit, test new features and fix it.
Modified: py/dist/py/__init__.py
==============================================================================
--- py/dist/py/__init__.py (original)
+++ py/dist/py/__init__.py Tue Jan 9 13:03:45 2007
@@ -30,7 +30,6 @@
'test.fail' : ('./test/item.py', 'fail'),
'test.exit' : ('./test/session.py', 'exit'),
'test.compat.TestCase' : ('./test/compat.py', 'TestCase'),
- 'test.remote' : ('./test/rsession/rsession.py', 'remote_options'),
# configuration/initialization related test api
'test.Config' : ('./test/config.py', 'Config'),
Modified: py/dist/py/test/rsession/box.py
==============================================================================
--- py/dist/py/test/rsession/box.py (original)
+++ py/dist/py/test/rsession/box.py Tue Jan 9 13:03:45 2007
@@ -54,8 +54,9 @@
self.PYTESTRETVAL = tempdir.join('retval')
self.PYTESTSTDOUT = tempdir.join('stdout')
self.PYTESTSTDERR = tempdir.join('stderr')
-
- nice_level = py.test.remote.nice_level
+
+ from py.__.test.rsession.rsession import remote_options
+ nice_level = remote_options.nice_level
pid = os.fork()
if pid:
if not continuation:
Modified: py/dist/py/test/rsession/outcome.py
==============================================================================
--- py/dist/py/test/rsession/outcome.py (original)
+++ py/dist/py/test/rsession/outcome.py Tue Jan 9 13:03:45 2007
@@ -32,7 +32,8 @@
relline = lineno - tb_entry.frame.code.firstlineno
path = str(tb_entry.path)
try:
- if py.test.remote.tbstyle == 'long':
+ from py.__.test.rsession.rsession import remote_options
+ if remote_options.tbstyle == 'long':
source = str(tb_entry.getsource())
else:
source = str(tb_entry.getsource()).split("\n")[relline]
Modified: py/dist/py/test/rsession/rsession.py
==============================================================================
--- py/dist/py/test/rsession/rsession.py (original)
+++ py/dist/py/test/rsession/rsession.py Tue Jan 9 13:03:45 2007
@@ -160,7 +160,9 @@
"""
self.was_failure = False
def new_reporter(event):
- if isinstance(event, report.ReceivedItemOutcome) and not event.outcome.passed and not event.outcome.skipped:
+ if isinstance(event, report.ReceivedItemOutcome) and \
+ not event.outcome.passed and \
+ not event.outcome.skipped:
self.was_failure = True
return reporter(event)
checkfun = lambda : self.config.option.exitfirst and \
Modified: py/dist/py/test/rsession/slave.py
==============================================================================
--- py/dist/py/test/rsession/slave.py (original)
+++ py/dist/py/test/rsession/slave.py Tue Jan 9 13:03:45 2007
@@ -62,7 +62,8 @@
excinfo = py.code.ExceptionInfo()
send(Outcome(excinfo=excinfo, is_critical=True).make_repr())
else:
- if not res[0] and py.test.remote.exitfirst:
+ from py.__.test.rsession.rsession import remote_options
+ if not res[0] and not res[3] and remote_options.exitfirst:
# we're finished, but need to eat what we can
send(res)
break
@@ -96,10 +97,11 @@
from py.__.test.rsession.rsession import RemoteOptions
from py.__.test.rsession.slave import Info
Info.pid = 0
- py.test.remote = RemoteOptions(options)
+ from py.__.test.rsession import rsession
+ rsession.remote_options = RemoteOptions(options)
# XXX the following assumes that py lib is there, a bit
- # much of an assumtion
- if not py.test.remote.nomagic:
+ # much of an assumtion
+ if not rsession.remote_options.nomagic:
py.magic.invoke(assertion=1)
mod = __import__(pkgname)
assert py.path.local(mod.__file__).dirpath() == py.path.local(pkgdir)
@@ -107,5 +109,5 @@
queue = Queue()
channel.setcallback(callback_gen(queue))
slave_main(queue.get, channel.send, basedir)
- if not py.test.remote.nomagic:
+ if not rsession.remote_options.nomagic:
py.magic.revoke(assertion=1)
Modified: py/dist/py/test/rsession/testing/test_rsession.py
==============================================================================
--- py/dist/py/test/rsession/testing/test_rsession.py (original)
+++ py/dist/py/test/rsession/testing/test_rsession.py Tue Jan 9 13:03:45 2007
@@ -118,6 +118,9 @@
tmpdir.ensure("sub", "test_one.py").write(py.code.Source("""
def test_1():
pass
+ def test_x():
+ import py
+ py.test.skip("aaa")
def test_2():
assert 0
def test_3():
@@ -132,8 +135,8 @@
rsession.main(args, reporter=allevents.append)
testevents = [x for x in allevents
if isinstance(x, report.ReceivedItemOutcome)]
+ assert len(testevents) == 3
assert rsession.checkfun()
- assert len(testevents) == 2
def test_example_distribution(self):
subdir = "sub_example_dist"
Modified: py/dist/py/test/rsession/testing/test_slave.py
==============================================================================
--- py/dist/py/test/rsession/testing/test_slave.py (original)
+++ py/dist/py/test/rsession/testing/test_slave.py Tue Jan 9 13:03:45 2007
@@ -35,10 +35,12 @@
asddsa
def funcoption():
- assert py.test.remote.we_are_remote
+ from py.__.test.rsession.rsession import remote_options
+ assert remote_options.we_are_remote
def funcoptioncustom():
- assert py.test.remote.custom == "custom"
+ from py.__.test.rsession.rsession import remote_options
+ assert remote_options.custom == "custom"
def funchang():
import time
More information about the py-svn
mailing list