Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Twisted tests now pass under --debug-stacktraces
Our tests make assertions that only hold when debugging is disabled. This patch updates the code to ensure that debugging is in the state we want.
- Loading branch information
Showing
5 changed files
with
45 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
pbr>=0.11 | ||
extras | ||
fixtures>=1.3.0 | ||
pyrsistent | ||
# 'mimeparse' has not been uploaded by the maintainer with Python3 compat | ||
# but someone kindly uploaded a fixed version as 'python-mimeparse'. | ||
python-mimeparse | ||
unittest2>=1.0.0 | ||
traceback2 | ||
fixtures>=1.3.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Copyright (c) testtools developers. See LICENSE for details. | ||
# | ||
# TODO: Move this to testtools.twistedsupport. See testing-cabal/testtools#202. | ||
|
||
from fixtures import Fixture, MonkeyPatch | ||
|
||
|
||
class DebugTwisted(Fixture): | ||
"""Set debug options for Twisted.""" | ||
|
||
def __init__(self, debug=True): | ||
super(DebugTwisted, self).__init__() | ||
self._debug_setting = debug | ||
|
||
def _setUp(self): | ||
self.useFixture( | ||
MonkeyPatch('twisted.internet.defer.Deferred.debug', | ||
self._debug_setting)) | ||
self.useFixture( | ||
MonkeyPatch('twisted.internet.base.DelayedCall.debug', | ||
self._debug_setting)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters