diff options
| author | Robert Collins <robertc@robertcollins.net> | 2013-03-04 00:42:05 +1300 |
|---|---|---|
| committer | Robert Collins <robertc@robertcollins.net> | 2013-03-04 00:42:05 +1300 |
| commit | b831924df3a020b5ac8b015ac0f584986610fa6a (patch) | |
| tree | f005e51da505f4b40ad673d1d5004a6be5a51fb3 /python/subunit/run.py | |
| parent | e1ee5b0f48a3d4fe7f9c0f83b2022ce169e91ae7 (diff) | |
| download | subunit-b831924df3a020b5ac8b015ac0f584986610fa6a.tar.gz | |
Fix up buffering to make pdb usable.
Diffstat (limited to 'python/subunit/run.py')
| -rwxr-xr-x | python/subunit/run.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/python/subunit/run.py b/python/subunit/run.py index 479691d..2e07d86 100755 --- a/python/subunit/run.py +++ b/python/subunit/run.py @@ -20,6 +20,7 @@ $ python -m subunit.run mylib.tests.test_suite """ +import os import sys from testtools import ExtendedToStreamDecorator @@ -84,6 +85,9 @@ class SubunitTestProgram(TestProgram): if __name__ == '__main__': + # Disable the default buffering, for Python 2.x where pdb doesn't do it + # on non-ttys. + sys.stdout = os.fdopen(sys.stdout.fileno(), 'ab', 0) stream = get_default_formatter() runner = SubunitTestRunner SubunitTestProgram(module=None, argv=sys.argv, testRunner=runner, |
