[Checkins]
SVN: zope.app.twisted/trunk/src/zope/app/twisted/ftp/tests/t
Fixed tests. No semantic changes were made.
Shane Hathaway
shane at hathawaymix.org
Sat Jul 12 18:04:14 EDT 2008
Log message for revision 88300:
Fixed tests. No semantic changes were made.
Unfortunately, using doctest seems like a poor choice here.
Changed:
U zope.app.twisted/trunk/src/zope/app/twisted/ftp/tests/test_zopetrial.py
U zope.app.twisted/trunk/src/zope/app/twisted/ftp/tests/trial.txt
-=-
Modified: zope.app.twisted/trunk/src/zope/app/twisted/ftp/tests/test_zopetrial.py
===================================================================
--- zope.app.twisted/trunk/src/zope/app/twisted/ftp/tests/test_zopetrial.py 2008-07-12 21:09:12 UTC (rev 88299)
+++ zope.app.twisted/trunk/src/zope/app/twisted/ftp/tests/test_zopetrial.py 2008-07-12 22:04:13 UTC (rev 88300)
@@ -33,16 +33,19 @@
import re
import zope.testing.testrunner
+try:
+ orig_configure_logging = zope.testing.testrunner.configure_logging
+except AttributeError:
+ orig_configure_logging = None
-orig_configure_logging = zope.testing.testrunner.configure_logging
-
def setUp(test):
- # This setup is for testing the trial integration. This test indirectly
- # call the zope.testing.testrunner.configure_logging method which tries
- # to reconfigure the logging. This causes problems with some of the other
- # tests. Nullify this method now, this should OK since the logging should
- # all be set up at this stage.
- zope.testing.testrunner.configure_logging = lambda : None
+ if orig_configure_logging is not None:
+ # This setup is for testing the trial integration. This test
+ # indirectly calls the zope.testing.testrunner.configure_logging
+ # method, which tries to reconfigure the logging. This causes
+ # problems with some of the other tests. Nullify this method now;
+ # this should OK since the logging should all be set up at this stage.
+ zope.testing.testrunner.configure_logging = lambda : None
test.globs['this_directory'] = os.path.split(__file__)[0]
test.globs['saved-sys-info'] = (
@@ -55,9 +58,10 @@
def tearDown(test):
- # redefine the configure_logging method that we nullified in the setUp
- # for these tests.
- zope.testing.testrunner.configure_logging = orig_configure_logging
+ if orig_configure_logging is not None:
+ # redefine the configure_logging method that we nullified in the setUp
+ # for these tests.
+ zope.testing.testrunner.configure_logging = orig_configure_logging
sys.path[:], sys.argv[:] = test.globs['saved-sys-info'][:2]
gc.set_threshold(*test.globs['saved-sys-info'][3])
Modified: zope.app.twisted/trunk/src/zope/app/twisted/ftp/tests/trial.txt
===================================================================
--- zope.app.twisted/trunk/src/zope/app/twisted/ftp/tests/trial.txt 2008-07-12 21:09:12 UTC (rev 88299)
+++ zope.app.twisted/trunk/src/zope/app/twisted/ftp/tests/trial.txt 2008-07-12 22:04:13 UTC (rev 88300)
@@ -24,8 +24,10 @@
>>> sys.argv = 'test --tests-pattern ^trialtest$ '.split()
>>> testrunner.run(defaults)
... # doctest: +NORMALIZE_WHITESPACE
- Running unit tests:
+ Running zope.testing.testrunner.layer.UnitTests tests:
+ Set up zope.testing.testrunner.layer.UnitTests in N.NNN seconds.
<BLANKLINE>
+ <BLANKLINE>
Error in test test_error (trialtest.TestTrialTests)
Exception: this test is a broken trial test :-)
<BLANKLINE>
@@ -35,6 +37,8 @@
FailTest: I am a failed trial test
<BLANKLINE>
Ran 3 tests with 1 failures and 1 errors in N.NNN seconds.
+ Tearing down left over layers:
+ Tear down zope.testing.testrunner.layer.UnitTests in N.NNN seconds.
True
Here is the output from the same tests above but the setup method contains
@@ -43,20 +47,26 @@
>>> sys.argv = 'test --tests-pattern ^trialtestfs$ '.split()
>>> testrunner.run(defaults)
... # doctest: +NORMALIZE_WHITESPACE
- Running unit tests:
+ Running zope.testing.testrunner.layer.UnitTests tests:
+ Set up zope.testing.testrunner.layer.UnitTests in N.NNN seconds.
<BLANKLINE>
+ <BLANKLINE>
Error in test test_assert_ok (trialtestfs.TestTrialBrokenSetup)
Exception: broken setup
<BLANKLINE>
<BLANKLINE>
+ <BLANKLINE>
Error in test test_error (trialtestfs.TestTrialBrokenSetup)
Exception: broken setup
<BLANKLINE>
<BLANKLINE>
+ <BLANKLINE>
Error in test test_failure (trialtestfs.TestTrialBrokenSetup)
Exception: broken setup
<BLANKLINE>
Ran 3 tests with 0 failures and 3 errors in N.NNN seconds.
+ Tearing down left over layers:
+ Tear down zope.testing.testrunner.layer.UnitTests in N.NNN seconds.
True
Here is the output from the same tests but the teardown method contains
@@ -65,28 +75,36 @@
>>> sys.argv = 'test --tests-pattern ^trialtestft$ '.split()
>>> testrunner.run(defaults)
... # doctest: +NORMALIZE_WHITESPACE
- Running unit tests:
+ Running zope.testing.testrunner.layer.UnitTests tests:
+ Set up zope.testing.testrunner.layer.UnitTests in N.NNN seconds.
<BLANKLINE>
+ <BLANKLINE>
Error in test test_assert_ok (trialtestft.TestTrialBrokenTeardown)
Exception: broken tearDown
<BLANKLINE>
<BLANKLINE>
+ <BLANKLINE>
Error in test test_error (trialtestft.TestTrialBrokenTeardown)
Exception: this test is a broken trial test :-)
<BLANKLINE>
<BLANKLINE>
+ <BLANKLINE>
Error in test test_error (trialtestft.TestTrialBrokenTeardown)
Exception: broken tearDown
<BLANKLINE>
<BLANKLINE>
+ <BLANKLINE>
Failure in test test_failure (trialtestft.TestTrialBrokenTeardown)
FailTest: I am a failed trial test
<BLANKLINE>
<BLANKLINE>
+ <BLANKLINE>
Error in test test_failure (trialtestft.TestTrialBrokenTeardown)
Exception: broken tearDown
<BLANKLINE>
- Ran 3 tests with 1 failures and 4 errors in 0.118 seconds.
+ Ran 3 tests with 1 failures and 4 errors in N.NNN seconds.
+ Tearing down left over layers:
+ Tear down zope.testing.testrunner.layer.UnitTests in N.NNN seconds.
True
Make sure that errors are handled correctly if the postCaseCleanup method
@@ -102,16 +120,21 @@
>>> sys.argv = 'test --tests-pattern ^trialtest$ '.split()
>>> testrunner.run(defaults)
... # doctest: +NORMALIZE_WHITESPACE
- Running unit tests:
+ Running zope.testing.testrunner.layer.UnitTests tests:
+ Set up zope.testing.testrunner.layer.UnitTests in N.NNN seconds.
<BLANKLINE>
+ <BLANKLINE>
Error in test test_error (trialtest.TestTrialTests)
Exception: this test is a broken trial test :-)
<BLANKLINE>
<BLANKLINE>
+ <BLANKLINE>
Failure in test test_failure (trialtest.TestTrialTests)
FailTest: I am a failed trial test
<BLANKLINE>
Ran 3 tests with 1 failures and 1 errors in N.NNN seconds.
+ Tearing down left over layers:
+ Tear down zope.testing.testrunner.layer.UnitTests in N.NNN seconds.
True
Now un-patch the twisted trial janitor, so that it does actually clean the
More information about the Checkins
mailing list