Remove support for SUBUNIT_FORMATTER, which has been broken for a long time.
authorJelmer Vernooij <jelmer@samba.org>
Tue, 2 Dec 2014 23:48:46 +0000 (23:48 +0000)
committerRobert Collins <robertc@robertcollins.net>
Wed, 10 Dec 2014 20:56:12 +0000 (09:56 +1300)
NEWS
python/subunit/__init__.py
python/subunit/run.py

diff --git a/NEWS b/NEWS
index 7bc8ee6a9281ddb21a03974f2c6eb03bccb350d6..307c6451969142f15318968c84f88b9853beed95 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,12 @@ subunit release notes
 NEXT (In development)
 ---------------------
 
+BUGFIXES
+~~~~~~~~
+
+* SUBUNIT_FORMATTER which has not been honoured for years is now removed from 
+  the codebase. (Jelmer Vernooij)
+
 1.0.0
 -----
 
index 7f0aa8cd44dae67d93f067ef1245fc2840ab4cff..bfa27a13aa8c2c22742f0847c0332bed356e1953 100644 (file)
@@ -1250,22 +1250,6 @@ class TestResultStats(testresult.TestResult):
         return self.failed_tests == 0
 
 
-def get_default_formatter():
-    """Obtain the default formatter to write to.
-
-    :return: A file-like object.
-    """
-    formatter = os.getenv("SUBUNIT_FORMATTER")
-    if formatter:
-        return os.popen(formatter, "w")
-    else:
-        stream = sys.stdout
-        if sys.version_info > (3, 0):
-            if safe_hasattr(stream, 'buffer'):
-                stream = stream.buffer
-        return stream
-
-
 def read_test_list(path):
     """Read a list of test ids from a file on disk.
 
index e711dd6711570e5066b25d6420e1c30893c49687..8469ac9dcf39e9c6eda81c3fca256cd9980cfff0 100755 (executable)
@@ -26,7 +26,7 @@ import sys
 
 from testtools import ExtendedToStreamDecorator
 
-from subunit import StreamResultToBytes, get_default_formatter
+from subunit import StreamResultToBytes
 from subunit.test_results import AutoTimingTestResultDecorator
 from testtools.run import (
     BUFFEROUTPUT,
@@ -128,8 +128,6 @@ def main(argv=None, stdout=None):
     # stdout is None except in unit tests.
     if stdout is None:
         stdout = sys.stdout
-        # XXX: This is broken code- SUBUNIT_FORMATTER is not being honoured.
-        stream = get_default_formatter()
         # Disable the default buffering, for Python 2.x where pdb doesn't do it
         # on non-ttys.
         if hasattr(stdout, 'fileno'):