Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 330316 Details for
Bug 444422
dev-python/pytest-2.0.3 fails tests with python-2.7
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
build.log
pytest-2.0.3_build.log (text/plain), 103.03 KB, created by
Nikoli
on 2012-11-23 10:56:36 UTC
(
hide
)
Description:
build.log
Filename:
MIME Type:
Creator:
Nikoli
Created:
2012-11-23 10:56:36 UTC
Size:
103.03 KB
patch
obsolete
> * Package: dev-python/pytest-2.0.3 > * Repository: gentoo > * Maintainer: python@gentoo.org > * USE: amd64 elibc_glibc kernel_linux multilib test userland_GNU > * FEATURES: sandbox test userpriv usersandbox >>>> Unpacking source... >>>> Unpacking pytest-2.0.3.zip to /var/tmp/portage/dev-python/pytest-2.0.3/work >>>> Source unpacked in /var/tmp/portage/dev-python/pytest-2.0.3/work >>>> Preparing source in /var/tmp/portage/dev-python/pytest-2.0.3/work/pytest-2.0.3 ... >>>> Source prepared. >>>> Configuring source in /var/tmp/portage/dev-python/pytest-2.0.3/work/pytest-2.0.3 ... >>>> Source configured. >>>> Compiling source in /var/tmp/portage/dev-python/pytest-2.0.3/work/pytest-2.0.3 ... > * Building of dev-python/pytest-2.0.3 with CPython 2.7... >python2.7 setup.py build -b build-2.7 >running build >running build_py >creating build-2.7 >creating build-2.7/lib >copying pytest.py -> build-2.7/lib >creating build-2.7/lib/_pytest >copying _pytest/main.py -> build-2.7/lib/_pytest >copying _pytest/hookspec.py -> build-2.7/lib/_pytest >copying _pytest/pytester.py -> build-2.7/lib/_pytest >copying _pytest/mark.py -> build-2.7/lib/_pytest >copying _pytest/helpconfig.py -> build-2.7/lib/_pytest >copying _pytest/capture.py -> build-2.7/lib/_pytest >copying _pytest/nose.py -> build-2.7/lib/_pytest >copying _pytest/tmpdir.py -> build-2.7/lib/_pytest >copying _pytest/__init__.py -> build-2.7/lib/_pytest >copying _pytest/pdb.py -> build-2.7/lib/_pytest >copying _pytest/resultlog.py -> build-2.7/lib/_pytest >copying _pytest/pastebin.py -> build-2.7/lib/_pytest >copying _pytest/monkeypatch.py -> build-2.7/lib/_pytest >copying _pytest/doctest.py -> build-2.7/lib/_pytest >copying _pytest/junitxml.py -> build-2.7/lib/_pytest >copying _pytest/assertion.py -> build-2.7/lib/_pytest >copying _pytest/recwarn.py -> build-2.7/lib/_pytest >copying _pytest/python.py -> build-2.7/lib/_pytest >copying _pytest/config.py -> build-2.7/lib/_pytest >copying _pytest/genscript.py -> build-2.7/lib/_pytest >copying _pytest/standalonetemplate.py -> build-2.7/lib/_pytest >copying _pytest/skipping.py -> build-2.7/lib/_pytest >copying _pytest/unittest.py -> build-2.7/lib/_pytest >copying _pytest/core.py -> build-2.7/lib/_pytest >copying _pytest/terminal.py -> build-2.7/lib/_pytest >copying _pytest/runner.py -> build-2.7/lib/_pytest >warning: build_py: byte-compiling is disabled, skipping. > >>>> Source compiled. > * Testing of dev-python/pytest-2.0.3 with CPython 2.7... >/var/tmp/portage/dev-python/pytest-2.0.3/work/pytest-2.0.3/build-2.7/lib/_pytest/core.py:148: UserWarning: Module _pytest was already imported from /var/tmp/portage/dev-python/pytest-2.0.3/work/pytest-2.0.3/build-2.7/lib/_pytest/__init__.py, but /usr/lib64/python2.7/site-packages is being added to sys.path > from pkg_resources import iter_entry_points, DistributionNotFound >/var/tmp/portage/dev-python/pytest-2.0.3/work/pytest-2.0.3/build-2.7/lib/_pytest/core.py:148: UserWarning: Module pytest was already imported from /var/tmp/portage/dev-python/pytest-2.0.3/work/pytest-2.0.3/build-2.7/lib/pytest.py, but /usr/lib64/python2.7/site-packages is being added to sys.path > from pkg_resources import iter_entry_points, DistributionNotFound >[1m============================= test session starts ==============================[0m >platform linux2 -- Python 2.7.3 -- pytest-2.0.3 >[1m collecting 0 items[0m[1m collecting 1 items[0m[1m collecting 3 items[0m[1m collecting 3 items[0m[1m collecting 3 items[0m[1m collecting 4 items[0m[1m collecting 5 items[0m[1m collecting 7 items[0m[1m collecting 27 items[0m[1m collecting 27 items[0m[1m collecting 43 items[0m[1m collecting 43 items[0m[1m collecting 43 items[0m[1m collecting 46 items[0m[1m collecting 46 items[0m[1m collecting 58 items[0m[1m collecting 58 items[0m[1m collecting 65 items[0m[1m collecting 71 items[0m[1m collecting 71 items[0m[1m collecting 77 items[0m[1m collecting 77 items[0m[1m collecting 83 items[0m[1m collecting 83 items[0m[1m collecting 87 items[0m[1m collecting 87 items[0m[1m collecting 95 items[0m[1m collecting 100 items[0m[1m collecting 100 items[0m[1m collecting 102 items[0m[1m collecting 102 items[0m[1m collecting 104 items[0m[1m collecting 104 items[0m[1m collecting 107 items[0m[1m collecting 107 items[0m[1m collecting 112 items[0m[1m collecting 112 items[0m[1m collecting 121 items[0m[1m collecting 121 items[0m[1m collecting 123 items[0m[1m collecting 123 items[0m[1m collecting 126 items[0m[1m collecting 126 items[0m[1m collecting 127 items[0m[1m collecting 135 items[0m[1m collecting 135 items[0m[1m collecting 136 items[0m[1m collecting 136 items[0m[1m collecting 145 items[0m[1m collecting 145 items[0m[1m collecting 149 items[0m[1m collecting 167 items[0m[1m collecting 167 items[0m[1m collecting 178 items[0m[1m collecting 203 items[0m[1m collecting 203 items[0m[1m collecting 212 items[0m[1m collecting 212 items[0m[1m collecting 219 items[0m[1m collecting 219 items[0m[1m collecting 222 items[0m[1m collecting 222 items[0m[1m collecting 226 items[0m[1m collecting 226 items[0m[1m collecting 228 items[0m[1m collecting 236 items[0m[1m collecting 236 items[0m[1m collecting 236 items[0m[1m collecting 244 items[0m[1m collecting 250 items[0m[1m collecting 264 items[0m[1m collecting 264 items[0m[1m collecting 265 items[0m[1m collecting 265 items[0m[1m collecting 268 items[0m[1m collecting 275 items[0m[1m collecting 275 items[0m[1m collecting 284 items[0m[1m collecting 284 items[0m[1m collecting 287 items[0m[1m collecting 287 items[0m[1m collecting 291 items[0m[1m collecting 291 items[0m[1m collecting 291 items[0m[1m collecting 300 items[0m[1m collecting 308 items[0m[1m collecting 319 items[0m[1m collecting 319 items[0m[1m collecting 320 items[0m[1m collecting 322 items[0m[1m collecting 322 items[0m[1m collecting 322 items[0m[1m collecting 332 items[0m[1m collecting 332 items[0m[1m collecting 332 items[0m[1m collecting 339 items[0m[1m collecting 343 items[0m[1m collecting 343 items[0m[1m collecting 345 items[0m[1m collecting 345 items[0m[1m collecting 353 items[0m[1m collecting 353 items[0m[1m collecting 357 items[0m[1m collecting 357 items[0m[1m collecting 359 items[0m[1m collecting 359 items[0m[1m collecting 362 items[0m[1m collecting 362 items[0m[1m collecting 365 items[0m[1m collecting 365 items[0m[1m collecting 371 items[0m[1m collecting 371 items[0m[1m collecting 378 items[0m[1m collecting 378 items[0m[1m collecting 385 items[0m[1m collecting 385 items[0m[1m collecting 391 items[0m[1m collecting 391 items[0m[1m collecting 399 items[0m[1m collecting 399 items[0m[1m collecting 403 items[0m[1m collecting 403 items[0m[1m collecting 409 items[0m[1m collecting 409 items[0m[1m collecting 422 items[0m[1m collecting 430 items[0m[1m collecting 433 items[0m[1m collecting 433 items[0m[1m collecting 437 items[0m[1m collecting 441 items[0m[1m collecting 441 items[0m[1m collecting 452 items[0m[1m collecting 452 items[0m[1m collecting 463 items[0m[1m collecting 463 items[0m[1m collecting 465 items[0m[1m collecting 465 items[0m[1m collecting 474 items[0m[1m collecting 484 items[0m[1m collecting 496 items[0m[1m collecting 496 items[0m[1m collecting 499 items[0m[1m collecting 506 items[0m[1m collecting 506 items[0m[1m collecting 518 items[0m[1m collecting 518 items[0m[1m collecting 520 items[0m[1m collecting 520 items[0m[1m collecting 522 items[0m[1m collecting 522 items[0m[1m collecting 530 items[0m[1m collecting 544 items[0m[1m collecting 544 items[0m[1m collecting 550 items[0m[1m collecting 550 items[0m[1m collecting 553 items[0m[1m collecting 553 items[0m[1m collecting 560 items[0m[1m collecting 560 items[0m[1m collecting 580 items[0m[1m collecting 580 items[0m[1m collecting 590 items[0m[1m collecting 591 items[0m[1m collecting 591 items[0m[1m collecting 594 items[0m[1m collecting 594 items[0m[1m collecting 597 items[0m[1m collecting 600 items[0m[1m collecting 600 items[0m[1m collecting 617 items[0m[1m collected 617 items >[0m >doc/example/assertion/test_failures.py . >doc/example/assertion/test_setup_flow_example.py .. >doc/example/assertion/global_testmodule_config/test_hello.py . >doc/example/costlysetup/sub1/test_quick.py . >doc/example/costlysetup/sub2/test_two.py .. >testing/acceptance_test.py ..................................x. >testing/test_assertion.py ...................... >testing/test_capture.py ............x................. >testing/test_collection.py ...........x.................... >testing/test_config.py .......x.............. >testing/test_conftest.py ............................. >testing/test_core.py .................................................. >testing/test_doctest.py ........ >testing/test_genscript.py sss.ssss >testing/test_helpconfig.py ...... >testing/test_junitxml.py .................. >testing/test_mark.py ....................... >testing/test_monkeypatch.py ......... >testing/test_nose.py ........ >testing/test_parseopt.py ............ >testing/test_pastebin.py .. >testing/test_pdb.py ....sssss. >testing/test_pytester.py x...... >testing/test_python.py ................................................................................... >testing/test_recwarn.py ........ >testing/test_resultlog.py ....... >testing/test_runner.py ...............sssssssssss...x....... >testing/test_runner_xunit.py .......... >testing/test_session.py ............... >testing/test_skipping.py ............................... >testing/test_terminal.py .......s.....................s.............................. >testing/test_tmpdir.py ....... >testing/test_unittest.py ...............FFs.. > >=================================== FAILURES =================================== >______________ TestTrialUnittest.test_trial_exceptions_with_skips ______________ > >self = <test_unittest.TestTrialUnittest instance at 0x989d5a0e0> >testdir = <TmpTestdir local('/var/tmp/portage/dev-python/pytest-2.0.3/temp/pytest-0/testdir/test_trial_exceptions_with_skips0/test_trial_exceptions_with_skips')> > >[1m def test_trial_exceptions_with_skips(self, testdir):[0m >[1m testdir.makepyfile("""[0m >[1m from twisted.trial import unittest[0m >[1m import pytest[0m >[1m class TC(unittest.TestCase):[0m >[1m def test_hello(self):[0m >[1m pytest.skip("skip_in_method")[0m >[1m @pytest.mark.skipif("sys.version_info != 1")[0m >[1m def test_hello2(self):[0m >[1m pass[0m >[1m @pytest.mark.xfail(reason="iwanto")[0m >[1m def test_hello3(self):[0m >[1m assert 0[0m >[1m def test_hello4(self):[0m >[1m pytest.xfail("i2wanto")[0m >[1m def test_trial_skip(self):[0m >[1m pass[0m >[1m test_trial_skip.skip = "trialselfskip"[0m >[1m [0m >[1m def test_trial_todo(self):[0m >[1m assert 0[0m >[1m test_trial_todo.todo = "mytodo"[0m >[1m [0m >[1m def test_trial_todo_success(self):[0m >[1m pass[0m >[1m test_trial_todo_success.todo = "mytodo"[0m >[1m [0m >[1m class TC2(unittest.TestCase):[0m >[1m def setup_class(cls):[0m >[1m pytest.skip("skip_in_setup_class")[0m >[1m def test_method(self):[0m >[1m pass[0m >[1m """)[0m >[1m result = testdir.runpytest("-rxs")[0m >[1m> assert result.ret == 0[0m >[1m[31mE assert 1 == 0[0m >[1m[31mE + where 1 = 1[0m >[1m[31mE + where 1 = <_pytest.pytester.RunResult instance at 0x989d5af80>.ret[0m > >../../../../../work/pytest-2.0.3/testing/test_unittest.py:273: AssertionError >------------------------------- Captured stdout -------------------------------- >running ['/usr/bin/python2.7', '/var/tmp/portage/dev-python/pytest-2.0.3/work/pytest-2.0.3/build-2.7/lib/pytest.py', '--basetemp=/var/tmp/portage/dev-python/pytest-2.0.3/temp/pytest-0/testdir/test_trial_exceptions_with_skips0/test_trial_exceptions_with_skips/runpytest-0', '-rxs'] curdir= /var/tmp/portage/dev-python/pytest-2.0.3/temp/pytest-0/testdir/test_trial_exceptions_with_skips0/test_trial_exceptions_with_skips >==================================================================================== test session starts ===================================================================================== >platform linux2 -- Python 2.7.3 -- pytest-2.0.3 >collecting ... collected 8 items > >test_trial_exceptions_with_skips.py FsxFsxXs > >========================================================================================== FAILURES ========================================================================================== >_______________________________________________________________________________________ TC.test_hello ________________________________________________________________________________________ > >self = <test_trial_exceptions_with_skips.TC testMethod=test_hello> > > def __call__(self, *args, **kwargs): >> return self.run(*args, **kwargs) > >/usr/lib64/python2.7/site-packages/twisted/trial/unittest.py:737: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >self = <test_trial_exceptions_with_skips.TC testMethod=test_hello>, result = <TestCaseFunction 'test_hello'> > > def run(self, result): > """ > Run the test case, storing the results in C{result}. > > First runs C{setUp} on self, then runs the test method (defined in the > constructor), then runs C{tearDown}. Any of these may return > L{Deferred}s. After they complete, does some reactor cleanup. > > @param result: A L{TestResult} object. > """ > log.msg("--> %s <--" % (self.id())) > from twisted.internet import reactor > new_result = itrial.IReporter(result, None) > if new_result is None: > result = PyUnitResultAdapter(result) > else: > result = new_result > self._timedOut = False > result.startTest(self) > if self.getSkip(): # don't run test methods that are marked as .skip > result.addSkip(self, self.getSkip()) > result.stopTest(self) > return > self._installObserver() > > # All the code inside runThunk will be run such that warnings emitted > # by it will be collected and retrievable by flushWarnings. > def runThunk(): > self._passed = False > self._deprecateReactor(reactor) > try: > d = self.deferSetUp(None, result) > try: > self._wait(d) > finally: > self._cleanUp(result) > self._classCleanUp(result) > finally: > self._undeprecateReactor(reactor) > > self._warnings = [] >> _collectWarnings(self._warnings.append, runThunk) > >/usr/lib64/python2.7/site-packages/twisted/trial/unittest.py:1126: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >observeWarning = <built-in method append of list object at 0x53c9145248>, f = <function runThunk at 0x53c91472a8> > > def _collectWarnings(observeWarning, f, *args, **kwargs): > """ > Call C{f} with C{args} positional arguments and C{kwargs} keyword arguments > and collect all warnings which are emitted as a result in a list. > > @param observeWarning: A callable which will be invoked with a L{_Warning} > instance each time a warning is emitted. > > @return: The return value of C{f(*args, **kwargs)}. > """ > def showWarning(message, category, filename, lineno, file=None, line=None): > assert isinstance(message, Warning) > observeWarning(_Warning( > message.args[0], category, filename, lineno)) > > # Disable the per-module cache for every module otherwise if the warning > # which the caller is expecting us to collect was already emitted it won't > # be re-emitted by the call to f which happens below. > _setWarningRegistryToNone(sys.modules) > > origFilters = warnings.filters[:] > origShow = warnings.showwarning > warnings.simplefilter('always') > try: > warnings.showwarning = showWarning >> result = f(*args, **kwargs) > >/usr/lib64/python2.7/site-packages/twisted/trial/unittest.py:178: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > > def runThunk(): > self._passed = False > self._deprecateReactor(reactor) > try: >> d = self.deferSetUp(None, result) > >/usr/lib64/python2.7/site-packages/twisted/trial/unittest.py:1116: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >self = <test_trial_exceptions_with_skips.TC testMethod=test_hello>, ignored = None, result = <TestCaseFunction 'test_hello'> > > def deferSetUp(self, ignored, result): > d = self._run('setUp', result) > d.addCallbacks(self.deferTestMethod, self._ebDeferSetUp, > callbackArgs=(result,), >> errbackArgs=(result,)) > >/usr/lib64/python2.7/site-packages/twisted/trial/unittest.py:743: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >self = <Deferred at 0x53c90d87e8 current result: None>, callback = <bound method TC.deferTestMethod of <test_trial_exceptions_with_skips.TC testMethod=test_hello>> >errback = <bound method TC._ebDeferSetUp of <test_trial_exceptions_with_skips.TC testMethod=test_hello>>, callbackArgs = (<TestCaseFunction 'test_hello'>,), callbackKeywords = None >errbackArgs = (<TestCaseFunction 'test_hello'>,), errbackKeywords = None > > def addCallbacks(self, callback, errback=None, > callbackArgs=None, callbackKeywords=None, > errbackArgs=None, errbackKeywords=None): > """ > Add a pair of callbacks (success and error) to this L{Deferred}. > > These will be executed when the 'master' callback is run. > """ > assert callable(callback) > assert errback == None or callable(errback) > cbs = ((callback, callbackArgs, callbackKeywords), > (errback or (passthru), errbackArgs, errbackKeywords)) > self.callbacks.append(cbs) > > if self.called: >> self._runCallbacks() > >/usr/lib64/python2.7/site-packages/twisted/internet/defer.py:287: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >self = <Deferred at 0x53c90d87e8 current result: None> > > def _runCallbacks(self): > """ > Run the chain of callbacks once a result is available. > > This consists of a simple loop over all of the callbacks, calling each > with the current result and making the current result equal to the > return value (or raised exception) of that call. > > If C{self._runningCallbacks} is true, this loop won't run at all, since > it is already running above us on the call stack. If C{self.paused} is > true, the loop also won't run, because that's what it means to be > paused. > > The loop will terminate before processing all of the callbacks if a > C{Deferred} without a result is encountered. > > If a C{Deferred} I{with} a result is encountered, that result is taken > and the loop proceeds. > > @note: The implementation is complicated slightly by the fact that > chaining (associating two Deferreds with each other such that one > will wait for the result of the other, as happens when a Deferred is > returned from a callback on another Deferred) is supported > iteratively rather than recursively, to avoid running out of stack > frames when processing long chains. > """ > if self._runningCallbacks: > # Don't recursively run callbacks > return > > # Keep track of all the Deferreds encountered while propagating results > # up a chain. The way a Deferred gets onto this stack is by having > # added its _continuation() to the callbacks list of a second Deferred > # and then that second Deferred being fired. ie, if ever had _chainedTo > # set to something other than None, you might end up on this stack. > chain = [self] > > while chain: > current = chain[-1] > > if current.paused: > # This Deferred isn't going to produce a result at all. All the > # Deferreds up the chain waiting on it will just have to... > # wait. > return > > finished = True > current._chainedTo = None > while current.callbacks: > item = current.callbacks.pop(0) > callback, args, kw = item[ > isinstance(current.result, failure.Failure)] > args = args or () > kw = kw or {} > > # Avoid recursion if we can. > if callback is _CONTINUE: > # Give the waiting Deferred our current result and then > # forget about that result ourselves. > chainee = args[0] > chainee.result = current.result > current.result = None > # Making sure to update _debugInfo > if current._debugInfo is not None: > current._debugInfo.failResult = None > chainee.paused -= 1 > chain.append(chainee) > # Delay cleaning this Deferred and popping it from the chain > # until after we've dealt with chainee. > finished = False > break > > try: > current._runningCallbacks = True > try: > current.result = callback(current.result, *args, **kw) > finally: > current._runningCallbacks = False > except: > # Including full frame information in the Failure is quite > # expensive, so we avoid it unless self.debug is set. >> current.result = failure.Failure(captureVars=self.debug) >E TypeError: excstore() got an unexpected keyword argument 'captureVars' > >/usr/lib64/python2.7/site-packages/twisted/internet/defer.py:551: TypeError >_______________________________________________________________________________________ TC.test_hello4 _______________________________________________________________________________________ > >self = <test_trial_exceptions_with_skips.TC testMethod=test_hello4> > > def __call__(self, *args, **kwargs): >> return self.run(*args, **kwargs) > >/usr/lib64/python2.7/site-packages/twisted/trial/unittest.py:737: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >self = <test_trial_exceptions_with_skips.TC testMethod=test_hello4>, result = <TestCaseFunction 'test_hello4'> > > def run(self, result): > """ > Run the test case, storing the results in C{result}. > > First runs C{setUp} on self, then runs the test method (defined in the > constructor), then runs C{tearDown}. Any of these may return > L{Deferred}s. After they complete, does some reactor cleanup. > > @param result: A L{TestResult} object. > """ > log.msg("--> %s <--" % (self.id())) > from twisted.internet import reactor > new_result = itrial.IReporter(result, None) > if new_result is None: > result = PyUnitResultAdapter(result) > else: > result = new_result > self._timedOut = False > result.startTest(self) > if self.getSkip(): # don't run test methods that are marked as .skip > result.addSkip(self, self.getSkip()) > result.stopTest(self) > return > self._installObserver() > > # All the code inside runThunk will be run such that warnings emitted > # by it will be collected and retrievable by flushWarnings. > def runThunk(): > self._passed = False > self._deprecateReactor(reactor) > try: > d = self.deferSetUp(None, result) > try: > self._wait(d) > finally: > self._cleanUp(result) > self._classCleanUp(result) > finally: > self._undeprecateReactor(reactor) > > self._warnings = [] >> _collectWarnings(self._warnings.append, runThunk) > >/usr/lib64/python2.7/site-packages/twisted/trial/unittest.py:1126: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >observeWarning = <built-in method append of list object at 0x53c9210200>, f = <function runThunk at 0x53c91ff6e0> > > def _collectWarnings(observeWarning, f, *args, **kwargs): > """ > Call C{f} with C{args} positional arguments and C{kwargs} keyword arguments > and collect all warnings which are emitted as a result in a list. > > @param observeWarning: A callable which will be invoked with a L{_Warning} > instance each time a warning is emitted. > > @return: The return value of C{f(*args, **kwargs)}. > """ > def showWarning(message, category, filename, lineno, file=None, line=None): > assert isinstance(message, Warning) > observeWarning(_Warning( > message.args[0], category, filename, lineno)) > > # Disable the per-module cache for every module otherwise if the warning > # which the caller is expecting us to collect was already emitted it won't > # be re-emitted by the call to f which happens below. > _setWarningRegistryToNone(sys.modules) > > origFilters = warnings.filters[:] > origShow = warnings.showwarning > warnings.simplefilter('always') > try: > warnings.showwarning = showWarning >> result = f(*args, **kwargs) > >/usr/lib64/python2.7/site-packages/twisted/trial/unittest.py:178: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > > def runThunk(): > self._passed = False > self._deprecateReactor(reactor) > try: >> d = self.deferSetUp(None, result) > >/usr/lib64/python2.7/site-packages/twisted/trial/unittest.py:1116: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >self = <test_trial_exceptions_with_skips.TC testMethod=test_hello4>, ignored = None, result = <TestCaseFunction 'test_hello4'> > > def deferSetUp(self, ignored, result): > d = self._run('setUp', result) > d.addCallbacks(self.deferTestMethod, self._ebDeferSetUp, > callbackArgs=(result,), >> errbackArgs=(result,)) > >/usr/lib64/python2.7/site-packages/twisted/trial/unittest.py:743: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >self = <Deferred at 0x53c9210518 current result: None>, callback = <bound method TC.deferTestMethod of <test_trial_exceptions_with_skips.TC testMethod=test_hello4>> >errback = <bound method TC._ebDeferSetUp of <test_trial_exceptions_with_skips.TC testMethod=test_hello4>>, callbackArgs = (<TestCaseFunction 'test_hello4'>,), callbackKeywords = None >errbackArgs = (<TestCaseFunction 'test_hello4'>,), errbackKeywords = None > > def addCallbacks(self, callback, errback=None, > callbackArgs=None, callbackKeywords=None, > errbackArgs=None, errbackKeywords=None): > """ > Add a pair of callbacks (success and error) to this L{Deferred}. > > These will be executed when the 'master' callback is run. > """ > assert callable(callback) > assert errback == None or callable(errback) > cbs = ((callback, callbackArgs, callbackKeywords), > (errback or (passthru), errbackArgs, errbackKeywords)) > self.callbacks.append(cbs) > > if self.called: >> self._runCallbacks() > >/usr/lib64/python2.7/site-packages/twisted/internet/defer.py:287: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >self = <Deferred at 0x53c9210518 current result: None> > > def _runCallbacks(self): > """ > Run the chain of callbacks once a result is available. > > This consists of a simple loop over all of the callbacks, calling each > with the current result and making the current result equal to the > return value (or raised exception) of that call. > > If C{self._runningCallbacks} is true, this loop won't run at all, since > it is already running above us on the call stack. If C{self.paused} is > true, the loop also won't run, because that's what it means to be > paused. > > The loop will terminate before processing all of the callbacks if a > C{Deferred} without a result is encountered. > > If a C{Deferred} I{with} a result is encountered, that result is taken > and the loop proceeds. > > @note: The implementation is complicated slightly by the fact that > chaining (associating two Deferreds with each other such that one > will wait for the result of the other, as happens when a Deferred is > returned from a callback on another Deferred) is supported > iteratively rather than recursively, to avoid running out of stack > frames when processing long chains. > """ > if self._runningCallbacks: > # Don't recursively run callbacks > return > > # Keep track of all the Deferreds encountered while propagating results > # up a chain. The way a Deferred gets onto this stack is by having > # added its _continuation() to the callbacks list of a second Deferred > # and then that second Deferred being fired. ie, if ever had _chainedTo > # set to something other than None, you might end up on this stack. > chain = [self] > > while chain: > current = chain[-1] > > if current.paused: > # This Deferred isn't going to produce a result at all. All the > # Deferreds up the chain waiting on it will just have to... > # wait. > return > > finished = True > current._chainedTo = None > while current.callbacks: > item = current.callbacks.pop(0) > callback, args, kw = item[ > isinstance(current.result, failure.Failure)] > args = args or () > kw = kw or {} > > # Avoid recursion if we can. > if callback is _CONTINUE: > # Give the waiting Deferred our current result and then > # forget about that result ourselves. > chainee = args[0] > chainee.result = current.result > current.result = None > # Making sure to update _debugInfo > if current._debugInfo is not None: > current._debugInfo.failResult = None > chainee.paused -= 1 > chain.append(chainee) > # Delay cleaning this Deferred and popping it from the chain > # until after we've dealt with chainee. > finished = False > break > > try: > current._runningCallbacks = True > try: > current.result = callback(current.result, *args, **kw) > finally: > current._runningCallbacks = False > except: > # Including full frame information in the Failure is quite > # expensive, so we avoid it unless self.debug is set. >> current.result = failure.Failure(captureVars=self.debug) >E TypeError: excstore() got an unexpected keyword argument 'captureVars' > >/usr/lib64/python2.7/site-packages/twisted/internet/defer.py:551: TypeError >================================================================================== short test summary info =================================================================================== >XFAIL test_trial_exceptions_with_skips.py::TC::test_hello3 > iwanto >XFAIL test_trial_exceptions_with_skips.py::TC::test_trial_todo > mytodo >SKIP [1] /var/tmp/portage/dev-python/pytest-2.0.3/work/pytest-2.0.3/build-2.7/lib/_pytest/unittest.py:88: trialselfskip >SKIP [1] /var/tmp/portage/dev-python/pytest-2.0.3/temp/pytest-0/testdir/test_trial_exceptions_with_skips0/test_trial_exceptions_with_skips/test_trial_exceptions_with_skips.py:28: skip_in_setup_class >SKIP [1] /var/tmp/portage/dev-python/pytest-2.0.3/work/pytest-2.0.3/build-2.7/lib/_pytest/skipping.py:103: condition: sys.version_info != 1 >================================================================= 2 failed, 3 skipped, 2 xfailed, 1 xpassed in 0.22 seconds ================================================================== >------------------------------- Captured stderr -------------------------------- >/var/tmp/portage/dev-python/pytest-2.0.3/work/pytest-2.0.3/build-2.7/lib/_pytest/core.py:148: UserWarning: Module _pytest was already imported from /var/tmp/portage/dev-python/pytest-2.0.3/work/pytest-2.0.3/build-2.7/lib/_pytest/__init__.pyc, but /usr/lib64/python2.7/site-packages is being added to sys.path > from pkg_resources import iter_entry_points, DistributionNotFound >/var/tmp/portage/dev-python/pytest-2.0.3/work/pytest-2.0.3/build-2.7/lib/_pytest/core.py:148: UserWarning: Module pytest was already imported from /var/tmp/portage/dev-python/pytest-2.0.3/work/pytest-2.0.3/build-2.7/lib/pytest.pyc, but /usr/lib64/python2.7/site-packages is being added to sys.path > from pkg_resources import iter_entry_points, DistributionNotFound >______________________ TestTrialUnittest.test_trial_error ______________________ > >self = <test_unittest.TestTrialUnittest instance at 0x989b3e3f8> >testdir = <TmpTestdir local('/var/tmp/portage/dev-python/pytest-2.0.3/temp/pytest-0/testdir/test_trial_error0/test_trial_error')> > >[1m def test_trial_error(self, testdir):[0m >[1m testdir.makepyfile("""[0m >[1m from twisted.trial.unittest import TestCase[0m >[1m from twisted.internet.defer import Deferred[0m >[1m from twisted.internet import reactor[0m >[1m [0m >[1m class TC(TestCase):[0m >[1m def test_one(self):[0m >[1m crash[0m >[1m [0m >[1m def test_two(self):[0m >[1m def f(_):[0m >[1m crash[0m >[1m [0m >[1m d = Deferred()[0m >[1m d.addCallback(f)[0m >[1m reactor.callLater(0.3, d.callback, None)[0m >[1m return d[0m >[1m [0m >[1m def test_three(self):[0m >[1m def f():[0m >[1m pass # will never get called[0m >[1m reactor.callLater(0.3, f)[0m >[1m # will crash at teardown[0m >[1m [0m >[1m def test_four(self):[0m >[1m def f(_):[0m >[1m reactor.callLater(0.3, f)[0m >[1m crash[0m >[1m [0m >[1m d = Deferred()[0m >[1m d.addCallback(f)[0m >[1m reactor.callLater(0.3, d.callback, None)[0m >[1m return d[0m >[1m # will crash both at test time and at teardown[0m >[1m """)[0m >[1m result = testdir.runpytest()[0m >[1m result.stdout.fnmatch_lines([[0m >[1m "*ERRORS*",[0m >[1m "*DelayedCalls*",[0m >[1m "*test_four*",[0m >[1m "*NameError*crash*",[0m >[1m "*test_one*",[0m >[1m "*NameError*crash*",[0m >[1m "*test_three*",[0m >[1m "*DelayedCalls*",[0m >[1m "*test_two*",[0m >[1m> "*crash*",[0m >[1m[31mE Failed: remains unmatched: '*NameError*crash*', see stderr[0m > >../../../../../work/pytest-2.0.3/testing/test_unittest.py:332: Failed >------------------------------- Captured stdout -------------------------------- >running ['/usr/bin/python2.7', '/var/tmp/portage/dev-python/pytest-2.0.3/work/pytest-2.0.3/build-2.7/lib/pytest.py', '--basetemp=/var/tmp/portage/dev-python/pytest-2.0.3/temp/pytest-0/testdir/test_trial_error0/test_trial_error/runpytest-0'] curdir= /var/tmp/portage/dev-python/pytest-2.0.3/temp/pytest-0/testdir/test_trial_error0/test_trial_error >==================================================================================== test session starts ===================================================================================== >platform linux2 -- Python 2.7.3 -- pytest-2.0.3 >collecting ... collected 4 items > >test_trial_error.py FEFFFE > >=========================================================================================== ERRORS =========================================================================================== >_____________________________________________________________________________ ERROR at teardown of TC.test_four ______________________________________________________________________________ > >self = <twisted.internet.pollreactor.PollReactor object at 0x7cd2bb2d90> > > def runUntilCurrent(self): > """Run all pending timed calls. > """ > if self.threadCallQueue: > # Keep track of how many calls we actually make, as we're > # making them, in case another call is added to the queue > # while we're in this loop. > count = 0 > total = len(self.threadCallQueue) > for (f, a, kw) in self.threadCallQueue: > try: > f(*a, **kw) > except: > log.err() > count += 1 > if count == total: > break > del self.threadCallQueue[:count] > if self.threadCallQueue: > self.wakeUp() > > # insert new delayed calls now > self._insertNewDelayedCalls() > > now = self.seconds() > while self._pendingTimedCalls and (self._pendingTimedCalls[0].time <= now): > call = heappop(self._pendingTimedCalls) > if call.cancelled: > self._cancellations-=1 > continue > > if call.delayed_time > 0: > call.activate_delay() > heappush(self._pendingTimedCalls, call) > continue > > try: > call.called = 1 >> call.func(*call.args, **call.kw) > >/usr/lib64/python2.7/site-packages/twisted/internet/base.py:800: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >self = <Deferred at 0x7cd2d21560 current result: None>, result = None > > def callback(self, result): > """ > Run all success callbacks that have been added to this L{Deferred}. > > Each callback will have its result passed as the first argument to > the next; this way, the callbacks act as a 'processing chain'. If > the success-callback returns a L{Failure} or raises an L{Exception}, > processing will continue on the *error* callback chain. If a > callback (or errback) returns another L{Deferred}, this L{Deferred} > will be chained to it (and further callbacks will not run until that > L{Deferred} has a result). > """ > assert not isinstance(result, Deferred) >> self._startRunCallbacks(result) > >/usr/lib64/python2.7/site-packages/twisted/internet/defer.py:362: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >self = <Deferred at 0x7cd2d21560 current result: None>, result = None > > def _startRunCallbacks(self, result): > if self.called: > if self._suppressAlreadyCalled: > self._suppressAlreadyCalled = False > return > if self.debug: > if self._debugInfo is None: > self._debugInfo = DebugInfo() > extra = "\n" + self._debugInfo._getDebugTracebacks() > raise AlreadyCalledError(extra) > raise AlreadyCalledError > if self.debug: > if self._debugInfo is None: > self._debugInfo = DebugInfo() > self._debugInfo.invoker = traceback.format_stack()[:-2] > self.called = True > self.result = result >> self._runCallbacks() > >/usr/lib64/python2.7/site-packages/twisted/internet/defer.py:458: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >self = <Deferred at 0x7cd2d21560 current result: None> > > def _runCallbacks(self): > """ > Run the chain of callbacks once a result is available. > > This consists of a simple loop over all of the callbacks, calling each > with the current result and making the current result equal to the > return value (or raised exception) of that call. > > If C{self._runningCallbacks} is true, this loop won't run at all, since > it is already running above us on the call stack. If C{self.paused} is > true, the loop also won't run, because that's what it means to be > paused. > > The loop will terminate before processing all of the callbacks if a > C{Deferred} without a result is encountered. > > If a C{Deferred} I{with} a result is encountered, that result is taken > and the loop proceeds. > > @note: The implementation is complicated slightly by the fact that > chaining (associating two Deferreds with each other such that one > will wait for the result of the other, as happens when a Deferred is > returned from a callback on another Deferred) is supported > iteratively rather than recursively, to avoid running out of stack > frames when processing long chains. > """ > if self._runningCallbacks: > # Don't recursively run callbacks > return > > # Keep track of all the Deferreds encountered while propagating results > # up a chain. The way a Deferred gets onto this stack is by having > # added its _continuation() to the callbacks list of a second Deferred > # and then that second Deferred being fired. ie, if ever had _chainedTo > # set to something other than None, you might end up on this stack. > chain = [self] > > while chain: > current = chain[-1] > > if current.paused: > # This Deferred isn't going to produce a result at all. All the > # Deferreds up the chain waiting on it will just have to... > # wait. > return > > finished = True > current._chainedTo = None > while current.callbacks: > item = current.callbacks.pop(0) > callback, args, kw = item[ > isinstance(current.result, failure.Failure)] > args = args or () > kw = kw or {} > > # Avoid recursion if we can. > if callback is _CONTINUE: > # Give the waiting Deferred our current result and then > # forget about that result ourselves. > chainee = args[0] > chainee.result = current.result > current.result = None > # Making sure to update _debugInfo > if current._debugInfo is not None: > current._debugInfo.failResult = None > chainee.paused -= 1 > chain.append(chainee) > # Delay cleaning this Deferred and popping it from the chain > # until after we've dealt with chainee. > finished = False > break > > try: > current._runningCallbacks = True > try: > current.result = callback(current.result, *args, **kw) > finally: > current._runningCallbacks = False > except: > # Including full frame information in the Failure is quite > # expensive, so we avoid it unless self.debug is set. >> current.result = failure.Failure(captureVars=self.debug) >E TypeError: excstore() got an unexpected keyword argument 'captureVars' > >/usr/lib64/python2.7/site-packages/twisted/internet/defer.py:551: TypeError >______________________________________________________________________________ ERROR at teardown of TC.test_two ______________________________________________________________________________ > >self = <twisted.internet.pollreactor.PollReactor object at 0x7cd2bb2d90> > > def runUntilCurrent(self): > """Run all pending timed calls. > """ > if self.threadCallQueue: > # Keep track of how many calls we actually make, as we're > # making them, in case another call is added to the queue > # while we're in this loop. > count = 0 > total = len(self.threadCallQueue) > for (f, a, kw) in self.threadCallQueue: > try: > f(*a, **kw) > except: > log.err() > count += 1 > if count == total: > break > del self.threadCallQueue[:count] > if self.threadCallQueue: > self.wakeUp() > > # insert new delayed calls now > self._insertNewDelayedCalls() > > now = self.seconds() > while self._pendingTimedCalls and (self._pendingTimedCalls[0].time <= now): > call = heappop(self._pendingTimedCalls) > if call.cancelled: > self._cancellations-=1 > continue > > if call.delayed_time > 0: > call.activate_delay() > heappush(self._pendingTimedCalls, call) > continue > > try: > call.called = 1 >> call.func(*call.args, **call.kw) > >/usr/lib64/python2.7/site-packages/twisted/internet/base.py:800: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >self = <Deferred at 0x7cd2db9998 current result: None>, result = None > > def callback(self, result): > """ > Run all success callbacks that have been added to this L{Deferred}. > > Each callback will have its result passed as the first argument to > the next; this way, the callbacks act as a 'processing chain'. If > the success-callback returns a L{Failure} or raises an L{Exception}, > processing will continue on the *error* callback chain. If a > callback (or errback) returns another L{Deferred}, this L{Deferred} > will be chained to it (and further callbacks will not run until that > L{Deferred} has a result). > """ > assert not isinstance(result, Deferred) >> self._startRunCallbacks(result) > >/usr/lib64/python2.7/site-packages/twisted/internet/defer.py:362: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >self = <Deferred at 0x7cd2db9998 current result: None>, result = None > > def _startRunCallbacks(self, result): > if self.called: > if self._suppressAlreadyCalled: > self._suppressAlreadyCalled = False > return > if self.debug: > if self._debugInfo is None: > self._debugInfo = DebugInfo() > extra = "\n" + self._debugInfo._getDebugTracebacks() > raise AlreadyCalledError(extra) > raise AlreadyCalledError > if self.debug: > if self._debugInfo is None: > self._debugInfo = DebugInfo() > self._debugInfo.invoker = traceback.format_stack()[:-2] > self.called = True > self.result = result >> self._runCallbacks() > >/usr/lib64/python2.7/site-packages/twisted/internet/defer.py:458: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >self = <Deferred at 0x7cd2db9998 current result: None> > > def _runCallbacks(self): > """ > Run the chain of callbacks once a result is available. > > This consists of a simple loop over all of the callbacks, calling each > with the current result and making the current result equal to the > return value (or raised exception) of that call. > > If C{self._runningCallbacks} is true, this loop won't run at all, since > it is already running above us on the call stack. If C{self.paused} is > true, the loop also won't run, because that's what it means to be > paused. > > The loop will terminate before processing all of the callbacks if a > C{Deferred} without a result is encountered. > > If a C{Deferred} I{with} a result is encountered, that result is taken > and the loop proceeds. > > @note: The implementation is complicated slightly by the fact that > chaining (associating two Deferreds with each other such that one > will wait for the result of the other, as happens when a Deferred is > returned from a callback on another Deferred) is supported > iteratively rather than recursively, to avoid running out of stack > frames when processing long chains. > """ > if self._runningCallbacks: > # Don't recursively run callbacks > return > > # Keep track of all the Deferreds encountered while propagating results > # up a chain. The way a Deferred gets onto this stack is by having > # added its _continuation() to the callbacks list of a second Deferred > # and then that second Deferred being fired. ie, if ever had _chainedTo > # set to something other than None, you might end up on this stack. > chain = [self] > > while chain: > current = chain[-1] > > if current.paused: > # This Deferred isn't going to produce a result at all. All the > # Deferreds up the chain waiting on it will just have to... > # wait. > return > > finished = True > current._chainedTo = None > while current.callbacks: > item = current.callbacks.pop(0) > callback, args, kw = item[ > isinstance(current.result, failure.Failure)] > args = args or () > kw = kw or {} > > # Avoid recursion if we can. > if callback is _CONTINUE: > # Give the waiting Deferred our current result and then > # forget about that result ourselves. > chainee = args[0] > chainee.result = current.result > current.result = None > # Making sure to update _debugInfo > if current._debugInfo is not None: > current._debugInfo.failResult = None > chainee.paused -= 1 > chain.append(chainee) > # Delay cleaning this Deferred and popping it from the chain > # until after we've dealt with chainee. > finished = False > break > > try: > current._runningCallbacks = True > try: > current.result = callback(current.result, *args, **kw) > finally: > current._runningCallbacks = False > except: > # Including full frame information in the Failure is quite > # expensive, so we avoid it unless self.debug is set. >> current.result = failure.Failure(captureVars=self.debug) >E TypeError: excstore() got an unexpected keyword argument 'captureVars' > >/usr/lib64/python2.7/site-packages/twisted/internet/defer.py:551: TypeError >========================================================================================== FAILURES ========================================================================================== >________________________________________________________________________________________ TC.test_four ________________________________________________________________________________________ >NOTE: Incompatible Exception Representation, displaying natively: > >TimeoutError: <test_trial_error.TC testMethod=test_four> (test_four) still running at 120.0 secs > >________________________________________________________________________________________ TC.test_one _________________________________________________________________________________________ > >self = <test_trial_error.TC testMethod=test_one> > > def __call__(self, *args, **kwargs): >> return self.run(*args, **kwargs) > >/usr/lib64/python2.7/site-packages/twisted/trial/unittest.py:737: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >self = <test_trial_error.TC testMethod=test_one>, result = <TestCaseFunction 'test_one'> > > def run(self, result): > """ > Run the test case, storing the results in C{result}. > > First runs C{setUp} on self, then runs the test method (defined in the > constructor), then runs C{tearDown}. Any of these may return > L{Deferred}s. After they complete, does some reactor cleanup. > > @param result: A L{TestResult} object. > """ > log.msg("--> %s <--" % (self.id())) > from twisted.internet import reactor > new_result = itrial.IReporter(result, None) > if new_result is None: > result = PyUnitResultAdapter(result) > else: > result = new_result > self._timedOut = False > result.startTest(self) > if self.getSkip(): # don't run test methods that are marked as .skip > result.addSkip(self, self.getSkip()) > result.stopTest(self) > return > self._installObserver() > > # All the code inside runThunk will be run such that warnings emitted > # by it will be collected and retrievable by flushWarnings. > def runThunk(): > self._passed = False > self._deprecateReactor(reactor) > try: > d = self.deferSetUp(None, result) > try: > self._wait(d) > finally: > self._cleanUp(result) > self._classCleanUp(result) > finally: > self._undeprecateReactor(reactor) > > self._warnings = [] >> _collectWarnings(self._warnings.append, runThunk) > >/usr/lib64/python2.7/site-packages/twisted/trial/unittest.py:1126: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >observeWarning = <built-in method append of list object at 0x7cd2da0e60>, f = <function runThunk at 0x7cd2dae848> > > def _collectWarnings(observeWarning, f, *args, **kwargs): > """ > Call C{f} with C{args} positional arguments and C{kwargs} keyword arguments > and collect all warnings which are emitted as a result in a list. > > @param observeWarning: A callable which will be invoked with a L{_Warning} > instance each time a warning is emitted. > > @return: The return value of C{f(*args, **kwargs)}. > """ > def showWarning(message, category, filename, lineno, file=None, line=None): > assert isinstance(message, Warning) > observeWarning(_Warning( > message.args[0], category, filename, lineno)) > > # Disable the per-module cache for every module otherwise if the warning > # which the caller is expecting us to collect was already emitted it won't > # be re-emitted by the call to f which happens below. > _setWarningRegistryToNone(sys.modules) > > origFilters = warnings.filters[:] > origShow = warnings.showwarning > warnings.simplefilter('always') > try: > warnings.showwarning = showWarning >> result = f(*args, **kwargs) > >/usr/lib64/python2.7/site-packages/twisted/trial/unittest.py:178: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > > def runThunk(): > self._passed = False > self._deprecateReactor(reactor) > try: >> d = self.deferSetUp(None, result) > >/usr/lib64/python2.7/site-packages/twisted/trial/unittest.py:1116: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >self = <test_trial_error.TC testMethod=test_one>, ignored = None, result = <TestCaseFunction 'test_one'> > > def deferSetUp(self, ignored, result): > d = self._run('setUp', result) > d.addCallbacks(self.deferTestMethod, self._ebDeferSetUp, > callbackArgs=(result,), >> errbackArgs=(result,)) > >/usr/lib64/python2.7/site-packages/twisted/trial/unittest.py:743: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >self = <Deferred at 0x7cd2db21b8 current result: None>, callback = <bound method TC.deferTestMethod of <test_trial_error.TC testMethod=test_one>> >errback = <bound method TC._ebDeferSetUp of <test_trial_error.TC testMethod=test_one>>, callbackArgs = (<TestCaseFunction 'test_one'>,), callbackKeywords = None >errbackArgs = (<TestCaseFunction 'test_one'>,), errbackKeywords = None > > def addCallbacks(self, callback, errback=None, > callbackArgs=None, callbackKeywords=None, > errbackArgs=None, errbackKeywords=None): > """ > Add a pair of callbacks (success and error) to this L{Deferred}. > > These will be executed when the 'master' callback is run. > """ > assert callable(callback) > assert errback == None or callable(errback) > cbs = ((callback, callbackArgs, callbackKeywords), > (errback or (passthru), errbackArgs, errbackKeywords)) > self.callbacks.append(cbs) > > if self.called: >> self._runCallbacks() > >/usr/lib64/python2.7/site-packages/twisted/internet/defer.py:287: >_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > >self = <Deferred at 0x7cd2db21b8 current result: None> > > def _runCallbacks(self): > """ > Run the chain of callbacks once a result is available. > > This consists of a simple loop over all of the callbacks, calling each > with the current result and making the current result equal to the > return value (or raised exception) of that call. > > If C{self._runningCallbacks} is true, this loop won't run at all, since > it is already running above us on the call stack. If C{self.paused} is > true, the loop also won't run, because that's what it means to be > paused. > > The loop will terminate before processing all of the callbacks if a > C{Deferred} without a result is encountered. > > If a C{Deferred} I{with} a result is encountered, that result is taken > and the loop proceeds. > > @note: The implementation is complicated slightly by the fact that > chaining (associating two Deferreds with each other such that one > will wait for the result of the other, as happens when a Deferred is > returned from a callback on another Deferred) is supported > iteratively rather than recursively, to avoid running out of stack > frames when processing long chains. > """ > if self._runningCallbacks: > # Don't recursively run callbacks > return > > # Keep track of all the Deferreds encountered while propagating results > # up a chain. The way a Deferred gets onto this stack is by having > # added its _continuation() to the callbacks list of a second Deferred > # and then that second Deferred being fired. ie, if ever had _chainedTo > # set to something other than None, you might end up on this stack. > chain = [self] > > while chain: > current = chain[-1] > > if current.paused: > # This Deferred isn't going to produce a result at all. All the > # Deferreds up the chain waiting on it will just have to... > # wait. > return > > finished = True > current._chainedTo = None > while current.callbacks: > item = current.callbacks.pop(0) > callback, args, kw = item[ > isinstance(current.result, failure.Failure)] > args = args or () > kw = kw or {} > > # Avoid recursion if we can. > if callback is _CONTINUE: > # Give the waiting Deferred our current result and then > # forget about that result ourselves. > chainee = args[0] > chainee.result = current.result > current.result = None > # Making sure to update _debugInfo > if current._debugInfo is not None: > current._debugInfo.failResult = None > chainee.paused -= 1 > chain.append(chainee) > # Delay cleaning this Deferred and popping it from the chain > # until after we've dealt with chainee. > finished = False > break > > try: > current._runningCallbacks = True > try: > current.result = callback(current.result, *args, **kw) > finally: > current._runningCallbacks = False > except: > # Including full frame information in the Failure is quite > # expensive, so we avoid it unless self.debug is set. >> current.result = failure.Failure(captureVars=self.debug) >E TypeError: excstore() got an unexpected keyword argument 'captureVars' > >/usr/lib64/python2.7/site-packages/twisted/internet/defer.py:551: TypeError >_______________________________________________________________________________________ TC.test_three ________________________________________________________________________________________ >NOTE: Incompatible Exception Representation, displaying natively: > >DirtyReactorAggregateError: Reactor was unclean. >DelayedCalls: (set twisted.internet.base.DelayedCall.debug = True to debug) ><DelayedCall 0x7cd2db7ea8 [0.299198865891s] called=0 cancelled=0 f()> > >________________________________________________________________________________________ TC.test_two _________________________________________________________________________________________ >NOTE: Incompatible Exception Representation, displaying natively: > >TimeoutError: <test_trial_error.TC testMethod=test_two> (test_two) still running at 120.0 secs > >============================================================================ 4 failed, 2 error in 240.50 seconds ============================================================================= >------------------------------- Captured stderr -------------------------------- >/var/tmp/portage/dev-python/pytest-2.0.3/work/pytest-2.0.3/build-2.7/lib/_pytest/core.py:148: UserWarning: Module _pytest was already imported from /var/tmp/portage/dev-python/pytest-2.0.3/work/pytest-2.0.3/build-2.7/lib/_pytest/__init__.pyc, but /usr/lib64/python2.7/site-packages is being added to sys.path > from pkg_resources import iter_entry_points, DistributionNotFound >/var/tmp/portage/dev-python/pytest-2.0.3/work/pytest-2.0.3/build-2.7/lib/_pytest/core.py:148: UserWarning: Module pytest was already imported from /var/tmp/portage/dev-python/pytest-2.0.3/work/pytest-2.0.3/build-2.7/lib/pytest.pyc, but /usr/lib64/python2.7/site-packages is being added to sys.path > from pkg_resources import iter_entry_points, DistributionNotFound >nomatch: '*ERRORS*' > and: u'==================================================================================== test session starts =====================================================================================' > and: u'platform linux2 -- Python 2.7.3 -- pytest-2.0.3' > and: u'collecting ... collected 4 items' > and: u'' > and: u'test_trial_error.py FEFFFE' > and: u'' >fnmatch: '*ERRORS*' > with: u'=========================================================================================== ERRORS ===========================================================================================' >nomatch: '*DelayedCalls*' > and: u'_____________________________________________________________________________ ERROR at teardown of TC.test_four ______________________________________________________________________________' > and: u'' > and: u'self = <twisted.internet.pollreactor.PollReactor object at 0x7cd2bb2d90>' > and: u'' > and: u' def runUntilCurrent(self):' > and: u' """Run all pending timed calls.' > and: u' """' > and: u' if self.threadCallQueue:' > and: u" # Keep track of how many calls we actually make, as we're" > and: u' # making them, in case another call is added to the queue' > and: u" # while we're in this loop." > and: u' count = 0' > and: u' total = len(self.threadCallQueue)' > and: u' for (f, a, kw) in self.threadCallQueue:' > and: u' try:' > and: u' f(*a, **kw)' > and: u' except:' > and: u' log.err()' > and: u' count += 1' > and: u' if count == total:' > and: u' break' > and: u' del self.threadCallQueue[:count]' > and: u' if self.threadCallQueue:' > and: u' self.wakeUp()' > and: u' ' > and: u' # insert new delayed calls now' >fnmatch: '*DelayedCalls*' > with: u' self._insertNewDelayedCalls()' >nomatch: '*test_four*' > and: u' ' > and: u' now = self.seconds()' > and: u' while self._pendingTimedCalls and (self._pendingTimedCalls[0].time <= now):' > and: u' call = heappop(self._pendingTimedCalls)' > and: u' if call.cancelled:' > and: u' self._cancellations-=1' > and: u' continue' > and: u' ' > and: u' if call.delayed_time > 0:' > and: u' call.activate_delay()' > and: u' heappush(self._pendingTimedCalls, call)' > and: u' continue' > and: u' ' > and: u' try:' > and: u' call.called = 1' > and: u'> call.func(*call.args, **call.kw)' > and: u'' > and: u'/usr/lib64/python2.7/site-packages/twisted/internet/base.py:800: ' > and: u'_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ' > and: u'' > and: u'self = <Deferred at 0x7cd2d21560 current result: None>, result = None' > and: u'' > and: u' def callback(self, result):' > and: u' """' > and: u' Run all success callbacks that have been added to this L{Deferred}.' > and: u' ' > and: u' Each callback will have its result passed as the first argument to' > and: u" the next; this way, the callbacks act as a 'processing chain'. If" > and: u' the success-callback returns a L{Failure} or raises an L{Exception},' > and: u' processing will continue on the *error* callback chain. If a' > and: u' callback (or errback) returns another L{Deferred}, this L{Deferred}' > and: u' will be chained to it (and further callbacks will not run until that' > and: u' L{Deferred} has a result).' > and: u' """' > and: u' assert not isinstance(result, Deferred)' > and: u'> self._startRunCallbacks(result)' > and: u'' > and: u'/usr/lib64/python2.7/site-packages/twisted/internet/defer.py:362: ' > and: u'_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ' > and: u'' > and: u'self = <Deferred at 0x7cd2d21560 current result: None>, result = None' > and: u'' > and: u' def _startRunCallbacks(self, result):' > and: u' if self.called:' > and: u' if self._suppressAlreadyCalled:' > and: u' self._suppressAlreadyCalled = False' > and: u' return' > and: u' if self.debug:' > and: u' if self._debugInfo is None:' > and: u' self._debugInfo = DebugInfo()' > and: u' extra = "\\n" + self._debugInfo._getDebugTracebacks()' > and: u' raise AlreadyCalledError(extra)' > and: u' raise AlreadyCalledError' > and: u' if self.debug:' > and: u' if self._debugInfo is None:' > and: u' self._debugInfo = DebugInfo()' > and: u' self._debugInfo.invoker = traceback.format_stack()[:-2]' > and: u' self.called = True' > and: u' self.result = result' > and: u'> self._runCallbacks()' > and: u'' > and: u'/usr/lib64/python2.7/site-packages/twisted/internet/defer.py:458: ' > and: u'_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ' > and: u'' > and: u'self = <Deferred at 0x7cd2d21560 current result: None>' > and: u'' > and: u' def _runCallbacks(self):' > and: u' """' > and: u' Run the chain of callbacks once a result is available.' > and: u' ' > and: u' This consists of a simple loop over all of the callbacks, calling each' > and: u' with the current result and making the current result equal to the' > and: u' return value (or raised exception) of that call.' > and: u' ' > and: u" If C{self._runningCallbacks} is true, this loop won't run at all, since" > and: u' it is already running above us on the call stack. If C{self.paused} is' > and: u" true, the loop also won't run, because that's what it means to be" > and: u' paused.' > and: u' ' > and: u' The loop will terminate before processing all of the callbacks if a' > and: u' C{Deferred} without a result is encountered.' > and: u' ' > and: u' If a C{Deferred} I{with} a result is encountered, that result is taken' > and: u' and the loop proceeds.' > and: u' ' > and: u' @note: The implementation is complicated slightly by the fact that' > and: u' chaining (associating two Deferreds with each other such that one' > and: u' will wait for the result of the other, as happens when a Deferred is' > and: u' returned from a callback on another Deferred) is supported' > and: u' iteratively rather than recursively, to avoid running out of stack' > and: u' frames when processing long chains.' > and: u' """' > and: u' if self._runningCallbacks:' > and: u" # Don't recursively run callbacks" > and: u' return' > and: u' ' > and: u' # Keep track of all the Deferreds encountered while propagating results' > and: u' # up a chain. The way a Deferred gets onto this stack is by having' > and: u' # added its _continuation() to the callbacks list of a second Deferred' > and: u' # and then that second Deferred being fired. ie, if ever had _chainedTo' > and: u' # set to something other than None, you might end up on this stack.' > and: u' chain = [self]' > and: u' ' > and: u' while chain:' > and: u' current = chain[-1]' > and: u' ' > and: u' if current.paused:' > and: u" # This Deferred isn't going to produce a result at all. All the" > and: u' # Deferreds up the chain waiting on it will just have to...' > and: u' # wait.' > and: u' return' > and: u' ' > and: u' finished = True' > and: u' current._chainedTo = None' > and: u' while current.callbacks:' > and: u' item = current.callbacks.pop(0)' > and: u' callback, args, kw = item[' > and: u' isinstance(current.result, failure.Failure)]' > and: u' args = args or ()' > and: u' kw = kw or {}' > and: u' ' > and: u' # Avoid recursion if we can.' > and: u' if callback is _CONTINUE:' > and: u' # Give the waiting Deferred our current result and then' > and: u' # forget about that result ourselves.' > and: u' chainee = args[0]' > and: u' chainee.result = current.result' > and: u' current.result = None' > and: u' # Making sure to update _debugInfo' > and: u' if current._debugInfo is not None:' > and: u' current._debugInfo.failResult = None' > and: u' chainee.paused -= 1' > and: u' chain.append(chainee)' > and: u' # Delay cleaning this Deferred and popping it from the chain' > and: u" # until after we've dealt with chainee." > and: u' finished = False' > and: u' break' > and: u' ' > and: u' try:' > and: u' current._runningCallbacks = True' > and: u' try:' > and: u' current.result = callback(current.result, *args, **kw)' > and: u' finally:' > and: u' current._runningCallbacks = False' > and: u' except:' > and: u' # Including full frame information in the Failure is quite' > and: u' # expensive, so we avoid it unless self.debug is set.' > and: u'> current.result = failure.Failure(captureVars=self.debug)' > and: u"E TypeError: excstore() got an unexpected keyword argument 'captureVars'" > and: u'' > and: u'/usr/lib64/python2.7/site-packages/twisted/internet/defer.py:551: TypeError' > and: u'______________________________________________________________________________ ERROR at teardown of TC.test_two ______________________________________________________________________________' > and: u'' > and: u'self = <twisted.internet.pollreactor.PollReactor object at 0x7cd2bb2d90>' > and: u'' > and: u' def runUntilCurrent(self):' > and: u' """Run all pending timed calls.' > and: u' """' > and: u' if self.threadCallQueue:' > and: u" # Keep track of how many calls we actually make, as we're" > and: u' # making them, in case another call is added to the queue' > and: u" # while we're in this loop." > and: u' count = 0' > and: u' total = len(self.threadCallQueue)' > and: u' for (f, a, kw) in self.threadCallQueue:' > and: u' try:' > and: u' f(*a, **kw)' > and: u' except:' > and: u' log.err()' > and: u' count += 1' > and: u' if count == total:' > and: u' break' > and: u' del self.threadCallQueue[:count]' > and: u' if self.threadCallQueue:' > and: u' self.wakeUp()' > and: u' ' > and: u' # insert new delayed calls now' > and: u' self._insertNewDelayedCalls()' > and: u' ' > and: u' now = self.seconds()' > and: u' while self._pendingTimedCalls and (self._pendingTimedCalls[0].time <= now):' > and: u' call = heappop(self._pendingTimedCalls)' > and: u' if call.cancelled:' > and: u' self._cancellations-=1' > and: u' continue' > and: u' ' > and: u' if call.delayed_time > 0:' > and: u' call.activate_delay()' > and: u' heappush(self._pendingTimedCalls, call)' > and: u' continue' > and: u' ' > and: u' try:' > and: u' call.called = 1' > and: u'> call.func(*call.args, **call.kw)' > and: u'' > and: u'/usr/lib64/python2.7/site-packages/twisted/internet/base.py:800: ' > and: u'_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ' > and: u'' > and: u'self = <Deferred at 0x7cd2db9998 current result: None>, result = None' > and: u'' > and: u' def callback(self, result):' > and: u' """' > and: u' Run all success callbacks that have been added to this L{Deferred}.' > and: u' ' > and: u' Each callback will have its result passed as the first argument to' > and: u" the next; this way, the callbacks act as a 'processing chain'. If" > and: u' the success-callback returns a L{Failure} or raises an L{Exception},' > and: u' processing will continue on the *error* callback chain. If a' > and: u' callback (or errback) returns another L{Deferred}, this L{Deferred}' > and: u' will be chained to it (and further callbacks will not run until that' > and: u' L{Deferred} has a result).' > and: u' """' > and: u' assert not isinstance(result, Deferred)' > and: u'> self._startRunCallbacks(result)' > and: u'' > and: u'/usr/lib64/python2.7/site-packages/twisted/internet/defer.py:362: ' > and: u'_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ' > and: u'' > and: u'self = <Deferred at 0x7cd2db9998 current result: None>, result = None' > and: u'' > and: u' def _startRunCallbacks(self, result):' > and: u' if self.called:' > and: u' if self._suppressAlreadyCalled:' > and: u' self._suppressAlreadyCalled = False' > and: u' return' > and: u' if self.debug:' > and: u' if self._debugInfo is None:' > and: u' self._debugInfo = DebugInfo()' > and: u' extra = "\\n" + self._debugInfo._getDebugTracebacks()' > and: u' raise AlreadyCalledError(extra)' > and: u' raise AlreadyCalledError' > and: u' if self.debug:' > and: u' if self._debugInfo is None:' > and: u' self._debugInfo = DebugInfo()' > and: u' self._debugInfo.invoker = traceback.format_stack()[:-2]' > and: u' self.called = True' > and: u' self.result = result' > and: u'> self._runCallbacks()' > and: u'' > and: u'/usr/lib64/python2.7/site-packages/twisted/internet/defer.py:458: ' > and: u'_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ' > and: u'' > and: u'self = <Deferred at 0x7cd2db9998 current result: None>' > and: u'' > and: u' def _runCallbacks(self):' > and: u' """' > and: u' Run the chain of callbacks once a result is available.' > and: u' ' > and: u' This consists of a simple loop over all of the callbacks, calling each' > and: u' with the current result and making the current result equal to the' > and: u' return value (or raised exception) of that call.' > and: u' ' > and: u" If C{self._runningCallbacks} is true, this loop won't run at all, since" > and: u' it is already running above us on the call stack. If C{self.paused} is' > and: u" true, the loop also won't run, because that's what it means to be" > and: u' paused.' > and: u' ' > and: u' The loop will terminate before processing all of the callbacks if a' > and: u' C{Deferred} without a result is encountered.' > and: u' ' > and: u' If a C{Deferred} I{with} a result is encountered, that result is taken' > and: u' and the loop proceeds.' > and: u' ' > and: u' @note: The implementation is complicated slightly by the fact that' > and: u' chaining (associating two Deferreds with each other such that one' > and: u' will wait for the result of the other, as happens when a Deferred is' > and: u' returned from a callback on another Deferred) is supported' > and: u' iteratively rather than recursively, to avoid running out of stack' > and: u' frames when processing long chains.' > and: u' """' > and: u' if self._runningCallbacks:' > and: u" # Don't recursively run callbacks" > and: u' return' > and: u' ' > and: u' # Keep track of all the Deferreds encountered while propagating results' > and: u' # up a chain. The way a Deferred gets onto this stack is by having' > and: u' # added its _continuation() to the callbacks list of a second Deferred' > and: u' # and then that second Deferred being fired. ie, if ever had _chainedTo' > and: u' # set to something other than None, you might end up on this stack.' > and: u' chain = [self]' > and: u' ' > and: u' while chain:' > and: u' current = chain[-1]' > and: u' ' > and: u' if current.paused:' > and: u" # This Deferred isn't going to produce a result at all. All the" > and: u' # Deferreds up the chain waiting on it will just have to...' > and: u' # wait.' > and: u' return' > and: u' ' > and: u' finished = True' > and: u' current._chainedTo = None' > and: u' while current.callbacks:' > and: u' item = current.callbacks.pop(0)' > and: u' callback, args, kw = item[' > and: u' isinstance(current.result, failure.Failure)]' > and: u' args = args or ()' > and: u' kw = kw or {}' > and: u' ' > and: u' # Avoid recursion if we can.' > and: u' if callback is _CONTINUE:' > and: u' # Give the waiting Deferred our current result and then' > and: u' # forget about that result ourselves.' > and: u' chainee = args[0]' > and: u' chainee.result = current.result' > and: u' current.result = None' > and: u' # Making sure to update _debugInfo' > and: u' if current._debugInfo is not None:' > and: u' current._debugInfo.failResult = None' > and: u' chainee.paused -= 1' > and: u' chain.append(chainee)' > and: u' # Delay cleaning this Deferred and popping it from the chain' > and: u" # until after we've dealt with chainee." > and: u' finished = False' > and: u' break' > and: u' ' > and: u' try:' > and: u' current._runningCallbacks = True' > and: u' try:' > and: u' current.result = callback(current.result, *args, **kw)' > and: u' finally:' > and: u' current._runningCallbacks = False' > and: u' except:' > and: u' # Including full frame information in the Failure is quite' > and: u' # expensive, so we avoid it unless self.debug is set.' > and: u'> current.result = failure.Failure(captureVars=self.debug)' > and: u"E TypeError: excstore() got an unexpected keyword argument 'captureVars'" > and: u'' > and: u'/usr/lib64/python2.7/site-packages/twisted/internet/defer.py:551: TypeError' > and: u'========================================================================================== FAILURES ==========================================================================================' >fnmatch: '*test_four*' > with: u'________________________________________________________________________________________ TC.test_four ________________________________________________________________________________________' >nomatch: '*NameError*crash*' > and: u'NOTE: Incompatible Exception Representation, displaying natively:' > and: u'' > and: u'TimeoutError: <test_trial_error.TC testMethod=test_four> (test_four) still running at 120.0 secs' > and: u'' > and: u'________________________________________________________________________________________ TC.test_one _________________________________________________________________________________________' > and: u'' > and: u'self = <test_trial_error.TC testMethod=test_one>' > and: u'' > and: u' def __call__(self, *args, **kwargs):' > and: u'> return self.run(*args, **kwargs)' > and: u'' > and: u'/usr/lib64/python2.7/site-packages/twisted/trial/unittest.py:737: ' > and: u'_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ' > and: u'' > and: u"self = <test_trial_error.TC testMethod=test_one>, result = <TestCaseFunction 'test_one'>" > and: u'' > and: u' def run(self, result):' > and: u' """' > and: u' Run the test case, storing the results in C{result}.' > and: u' ' > and: u' First runs C{setUp} on self, then runs the test method (defined in the' > and: u' constructor), then runs C{tearDown}. Any of these may return' > and: u' L{Deferred}s. After they complete, does some reactor cleanup.' > and: u' ' > and: u' @param result: A L{TestResult} object.' > and: u' """' > and: u' log.msg("--> %s <--" % (self.id()))' > and: u' from twisted.internet import reactor' > and: u' new_result = itrial.IReporter(result, None)' > and: u' if new_result is None:' > and: u' result = PyUnitResultAdapter(result)' > and: u' else:' > and: u' result = new_result' > and: u' self._timedOut = False' > and: u' result.startTest(self)' > and: u" if self.getSkip(): # don't run test methods that are marked as .skip" > and: u' result.addSkip(self, self.getSkip())' > and: u' result.stopTest(self)' > and: u' return' > and: u' self._installObserver()' > and: u' ' > and: u' # All the code inside runThunk will be run such that warnings emitted' > and: u' # by it will be collected and retrievable by flushWarnings.' > and: u' def runThunk():' > and: u' self._passed = False' > and: u' self._deprecateReactor(reactor)' > and: u' try:' > and: u' d = self.deferSetUp(None, result)' > and: u' try:' > and: u' self._wait(d)' > and: u' finally:' > and: u' self._cleanUp(result)' > and: u' self._classCleanUp(result)' > and: u' finally:' > and: u' self._undeprecateReactor(reactor)' > and: u' ' > and: u' self._warnings = []' > and: u'> _collectWarnings(self._warnings.append, runThunk)' > and: u'' > and: u'/usr/lib64/python2.7/site-packages/twisted/trial/unittest.py:1126: ' > and: u'_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ' > and: u'' > and: u'observeWarning = <built-in method append of list object at 0x7cd2da0e60>, f = <function runThunk at 0x7cd2dae848>' > and: u'' > and: u' def _collectWarnings(observeWarning, f, *args, **kwargs):' > and: u' """' > and: u' Call C{f} with C{args} positional arguments and C{kwargs} keyword arguments' > and: u' and collect all warnings which are emitted as a result in a list.' > and: u' ' > and: u' @param observeWarning: A callable which will be invoked with a L{_Warning}' > and: u' instance each time a warning is emitted.' > and: u' ' > and: u' @return: The return value of C{f(*args, **kwargs)}.' > and: u' """' > and: u' def showWarning(message, category, filename, lineno, file=None, line=None):' > and: u' assert isinstance(message, Warning)' > and: u' observeWarning(_Warning(' > and: u' message.args[0], category, filename, lineno))' > and: u' ' > and: u' # Disable the per-module cache for every module otherwise if the warning' > and: u" # which the caller is expecting us to collect was already emitted it won't" > and: u' # be re-emitted by the call to f which happens below.' > and: u' _setWarningRegistryToNone(sys.modules)' > and: u' ' > and: u' origFilters = warnings.filters[:]' > and: u' origShow = warnings.showwarning' > and: u" warnings.simplefilter('always')" > and: u' try:' > and: u' warnings.showwarning = showWarning' > and: u'> result = f(*args, **kwargs)' > and: u'' > and: u'/usr/lib64/python2.7/site-packages/twisted/trial/unittest.py:178: ' > and: u'_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ' > and: u'' > and: u' def runThunk():' > and: u' self._passed = False' > and: u' self._deprecateReactor(reactor)' > and: u' try:' > and: u'> d = self.deferSetUp(None, result)' > and: u'' > and: u'/usr/lib64/python2.7/site-packages/twisted/trial/unittest.py:1116: ' > and: u'_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ' > and: u'' > and: u"self = <test_trial_error.TC testMethod=test_one>, ignored = None, result = <TestCaseFunction 'test_one'>" > and: u'' > and: u' def deferSetUp(self, ignored, result):' > and: u" d = self._run('setUp', result)" > and: u' d.addCallbacks(self.deferTestMethod, self._ebDeferSetUp,' > and: u' callbackArgs=(result,),' > and: u'> errbackArgs=(result,))' > and: u'' > and: u'/usr/lib64/python2.7/site-packages/twisted/trial/unittest.py:743: ' > and: u'_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ' > and: u'' > and: u'self = <Deferred at 0x7cd2db21b8 current result: None>, callback = <bound method TC.deferTestMethod of <test_trial_error.TC testMethod=test_one>>' > and: u"errback = <bound method TC._ebDeferSetUp of <test_trial_error.TC testMethod=test_one>>, callbackArgs = (<TestCaseFunction 'test_one'>,), callbackKeywords = None" > and: u"errbackArgs = (<TestCaseFunction 'test_one'>,), errbackKeywords = None" > and: u'' > and: u' def addCallbacks(self, callback, errback=None,' > and: u' callbackArgs=None, callbackKeywords=None,' > and: u' errbackArgs=None, errbackKeywords=None):' > and: u' """' > and: u' Add a pair of callbacks (success and error) to this L{Deferred}.' > and: u' ' > and: u" These will be executed when the 'master' callback is run." > and: u' """' > and: u' assert callable(callback)' > and: u' assert errback == None or callable(errback)' > and: u' cbs = ((callback, callbackArgs, callbackKeywords),' > and: u' (errback or (passthru), errbackArgs, errbackKeywords))' > and: u' self.callbacks.append(cbs)' > and: u' ' > and: u' if self.called:' > and: u'> self._runCallbacks()' > and: u'' > and: u'/usr/lib64/python2.7/site-packages/twisted/internet/defer.py:287: ' > and: u'_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ' > and: u'' > and: u'self = <Deferred at 0x7cd2db21b8 current result: None>' > and: u'' > and: u' def _runCallbacks(self):' > and: u' """' > and: u' Run the chain of callbacks once a result is available.' > and: u' ' > and: u' This consists of a simple loop over all of the callbacks, calling each' > and: u' with the current result and making the current result equal to the' > and: u' return value (or raised exception) of that call.' > and: u' ' > and: u" If C{self._runningCallbacks} is true, this loop won't run at all, since" > and: u' it is already running above us on the call stack. If C{self.paused} is' > and: u" true, the loop also won't run, because that's what it means to be" > and: u' paused.' > and: u' ' > and: u' The loop will terminate before processing all of the callbacks if a' > and: u' C{Deferred} without a result is encountered.' > and: u' ' > and: u' If a C{Deferred} I{with} a result is encountered, that result is taken' > and: u' and the loop proceeds.' > and: u' ' > and: u' @note: The implementation is complicated slightly by the fact that' > and: u' chaining (associating two Deferreds with each other such that one' > and: u' will wait for the result of the other, as happens when a Deferred is' > and: u' returned from a callback on another Deferred) is supported' > and: u' iteratively rather than recursively, to avoid running out of stack' > and: u' frames when processing long chains.' > and: u' """' > and: u' if self._runningCallbacks:' > and: u" # Don't recursively run callbacks" > and: u' return' > and: u' ' > and: u' # Keep track of all the Deferreds encountered while propagating results' > and: u' # up a chain. The way a Deferred gets onto this stack is by having' > and: u' # added its _continuation() to the callbacks list of a second Deferred' > and: u' # and then that second Deferred being fired. ie, if ever had _chainedTo' > and: u' # set to something other than None, you might end up on this stack.' > and: u' chain = [self]' > and: u' ' > and: u' while chain:' > and: u' current = chain[-1]' > and: u' ' > and: u' if current.paused:' > and: u" # This Deferred isn't going to produce a result at all. All the" > and: u' # Deferreds up the chain waiting on it will just have to...' > and: u' # wait.' > and: u' return' > and: u' ' > and: u' finished = True' > and: u' current._chainedTo = None' > and: u' while current.callbacks:' > and: u' item = current.callbacks.pop(0)' > and: u' callback, args, kw = item[' > and: u' isinstance(current.result, failure.Failure)]' > and: u' args = args or ()' > and: u' kw = kw or {}' > and: u' ' > and: u' # Avoid recursion if we can.' > and: u' if callback is _CONTINUE:' > and: u' # Give the waiting Deferred our current result and then' > and: u' # forget about that result ourselves.' > and: u' chainee = args[0]' > and: u' chainee.result = current.result' > and: u' current.result = None' > and: u' # Making sure to update _debugInfo' > and: u' if current._debugInfo is not None:' > and: u' current._debugInfo.failResult = None' > and: u' chainee.paused -= 1' > and: u' chain.append(chainee)' > and: u' # Delay cleaning this Deferred and popping it from the chain' > and: u" # until after we've dealt with chainee." > and: u' finished = False' > and: u' break' > and: u' ' > and: u' try:' > and: u' current._runningCallbacks = True' > and: u' try:' > and: u' current.result = callback(current.result, *args, **kw)' > and: u' finally:' > and: u' current._runningCallbacks = False' > and: u' except:' > and: u' # Including full frame information in the Failure is quite' > and: u' # expensive, so we avoid it unless self.debug is set.' > and: u'> current.result = failure.Failure(captureVars=self.debug)' > and: u"E TypeError: excstore() got an unexpected keyword argument 'captureVars'" > and: u'' > and: u'/usr/lib64/python2.7/site-packages/twisted/internet/defer.py:551: TypeError' > and: u'_______________________________________________________________________________________ TC.test_three ________________________________________________________________________________________' > and: u'NOTE: Incompatible Exception Representation, displaying natively:' > and: u'' > and: u'DirtyReactorAggregateError: Reactor was unclean.' > and: u'DelayedCalls: (set twisted.internet.base.DelayedCall.debug = True to debug)' > and: u'<DelayedCall 0x7cd2db7ea8 [0.299198865891s] called=0 cancelled=0 f()>' > and: u'' > and: u'________________________________________________________________________________________ TC.test_two _________________________________________________________________________________________' > and: u'NOTE: Incompatible Exception Representation, displaying natively:' > and: u'' > and: u'TimeoutError: <test_trial_error.TC testMethod=test_two> (test_two) still running at 120.0 secs' > and: u'' > and: u'============================================================================ 4 failed, 2 error in 240.50 seconds =============================================================================' >[1m======== 2 failed, 583 passed, 26 skipped, 6 xfailed in 312.45 seconds =========[0m > * ERROR: dev-python/pytest-2.0.3 failed (test phase): > * Testing failed with CPython 2.7 in testing() function > * > * Call stack: > * ebuild.sh, line 93: Called src_test > * environment, line 3703: Called python_execute_function 'testing' > * environment, line 2065: Called die > * The specific snippet of code: > * die "${failure_message}"; > * > * If you need support, post the output of `emerge --info '=dev-python/pytest-2.0.3'`, > * the complete build log and the output of `emerge -pqv '=dev-python/pytest-2.0.3'`. > * The complete build log is located at '/var/tmp/portage/dev-python/pytest-2.0.3/temp/build.log'. > * The ebuild environment file is located at '/var/tmp/portage/dev-python/pytest-2.0.3/temp/environment'. > * Working directory: '/var/tmp/portage/dev-python/pytest-2.0.3/work/pytest-2.0.3' > * S: '/var/tmp/portage/dev-python/pytest-2.0.3/work/pytest-2.0.3'
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 444422
: 330316