[py-svn] r51396 - py/branch/event/py/test2/testing
hpk at codespeak.net
hpk at codespeak.net
Mon Feb 11 20:58:08 CET 2008
Author: hpk
Date: Mon Feb 11 20:58:07 2008
New Revision: 51396
Removed:
py/branch/event/py/test2/testing/example1.py
py/branch/event/py/test2/testing/example2.py
Modified:
py/branch/event/py/test2/testing/test_boxing.py
py/branch/event/py/test2/testing/test_executor.py
Log:
remove or inline example test data
Deleted: /py/branch/event/py/test2/testing/example1.py
==============================================================================
--- /py/branch/event/py/test2/testing/example1.py Mon Feb 11 20:58:07 2008
+++ (empty file)
@@ -1,12 +0,0 @@
-
-def f1():
- f2()
-
-def f2():
- pass
-
-def g1():
- g2()
-
-def g2():
- raise ValueError()
Deleted: /py/branch/event/py/test2/testing/example2.py
==============================================================================
--- /py/branch/event/py/test2/testing/example2.py Mon Feb 11 20:58:07 2008
+++ (empty file)
@@ -1,30 +0,0 @@
-
-""" some example for running box stuff inside
-"""
-
-import sys
-import py, os
-
-def boxf1():
- print "some out"
- print >>sys.stderr, "some err"
- return 1
-
-def boxf2():
- os.write(1, "someout")
- os.write(2, "someerr")
- return 2
-
-def boxseg():
- os.kill(os.getpid(), 11)
-
-def boxhuge():
- os.write(1, " " * 10000)
- os.write(2, " " * 10000)
- os.write(1, " " * 10000)
-
- os.write(1, " " * 10000)
- os.write(2, " " * 10000)
- os.write(2, " " * 10000)
- os.write(1, " " * 10000)
- return 3
Modified: py/branch/event/py/test2/testing/test_boxing.py
==============================================================================
--- py/branch/event/py/test2/testing/test_boxing.py (original)
+++ py/branch/event/py/test2/testing/test_boxing.py Mon Feb 11 20:58:07 2008
@@ -8,7 +8,6 @@
py.test.skip("rsession is unsupported on Windows.")
from py.__.test2.box import Box
-from py.__.test2.testing import example2
def setup_module(mod):
tmpdir = py.test2.ensuretemp("boxtests")
@@ -18,7 +17,7 @@
# XXX: because we do not have option transfer
## if not hasattr(option, 'nocapture') or not option.nocapture:
## py.test.skip("Interacts with pylib i/o skipping which is bad actually")
- b = Box(example2.boxf1, config=config)
+ b = Box(boxf1, config=config)
b.run()
assert b.stdoutrepr == "some out\n"
assert b.stderrrepr == "some err\n"
@@ -27,7 +26,7 @@
assert b.retval == 1
def test_boxing_on_fds():
- b = Box(example2.boxf2, config=config)
+ b = Box(boxf2, config=config)
b.run()
assert b.stdoutrepr == "someout"
assert b.stderrrepr == "someerr"
@@ -36,7 +35,7 @@
assert b.retval == 2
def test_boxing_signal():
- b = Box(example2.boxseg, config=config)
+ b = Box(boxseg, config=config)
b.run()
assert b.retval is None
if py.std.sys.version_info < (2,4):
@@ -44,7 +43,7 @@
assert b.signal == 11
def test_boxing_huge_data():
- b = Box(example2.boxhuge, config=config)
+ b = Box(boxhuge, config=config)
b.run()
assert b.stdoutrepr
assert b.exitstat == 0
@@ -54,7 +53,7 @@
def test_box_seq():
# we run many boxes with huge data, just one after another
for i in xrange(100):
- b = Box(example2.boxhuge, config=config)
+ b = Box(boxhuge, config=config)
b.run()
assert b.stdoutrepr
assert b.exitstat == 0
@@ -63,7 +62,7 @@
def test_box_in_a_box():
def boxfun():
- b = Box(example2.boxf2, config=config)
+ b = Box(boxf2, config=config)
b.run()
print b.stdoutrepr
print >>sys.stderr, b.stderrrepr
@@ -93,3 +92,33 @@
if py.std.sys.version_info < (2,4):
py.test.skip("signal detection does not work with python prior 2.4")
assert b.signal == 15
+
+
+# ======================================================================
+# examples
+# ======================================================================
+#
+
+def boxf1():
+ print "some out"
+ print >>sys.stderr, "some err"
+ return 1
+
+def boxf2():
+ os.write(1, "someout")
+ os.write(2, "someerr")
+ return 2
+
+def boxseg():
+ os.kill(os.getpid(), 11)
+
+def boxhuge():
+ os.write(1, " " * 10000)
+ os.write(2, " " * 10000)
+ os.write(1, " " * 10000)
+
+ os.write(1, " " * 10000)
+ os.write(2, " " * 10000)
+ os.write(2, " " * 10000)
+ os.write(1, " " * 10000)
+ return 3
Modified: py/branch/event/py/test2/testing/test_executor.py
==============================================================================
--- py/branch/event/py/test2/testing/test_executor.py (original)
+++ py/branch/event/py/test2/testing/test_executor.py Mon Feb 11 20:58:07 2008
@@ -1,6 +1,5 @@
import py
-import example1
from py.__.test2.executor import RunExecutor, BoxExecutor,\
AsyncExecutor, ApigenExecutor
More information about the py-svn
mailing list