[SCM] Samba Shared Repository - branch master updated

Jelmer Vernooij jelmer at samba.org
Thu Dec 27 13:09:02 MST 2012


The branch, master has been updated
       via  bcacd8f subunit: Update to latest upstream version.
       via  983a3ea testtools: Update to latest upstream version.
      from  2495752 lib/param: use the correct path names again

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit bcacd8fc80f8b366566d576fd654856930cfc4a4
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Wed Dec 26 22:11:13 2012 +0100

    subunit: Update to latest upstream version.
    
    Autobuild-User(master): Jelmer Vernooij <jelmer at samba.org>
    Autobuild-Date(master): Thu Dec 27 21:08:32 CET 2012 on sn-devel-104

commit 983a3ea437d76b769b82726cc602d26e0e57894a
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Wed Dec 26 22:11:04 2012 +0100

    testtools: Update to latest upstream version.

-----------------------------------------------------------------------

Summary of changes:
 lib/subunit/INSTALL                                |    2 +-
 lib/subunit/MANIFEST.in                            |    1 -
 lib/subunit/Makefile.am                            |    3 +
 lib/subunit/NEWS                                   |   13 ++
 lib/subunit/README                                 |   13 ++
 lib/subunit/configure.ac                           |    2 +-
 lib/subunit/python/subunit/__init__.py             |   29 ++++-
 lib/subunit/python/subunit/run.py                  |   15 ++-
 lib/subunit/python/subunit/test_results.py         |    7 +
 .../python/subunit/tests/test_test_protocol.py     |   15 ++-
 .../python/subunit/tests/test_test_results.py      |    6 +
 lib/subunit/runtests.py                            |    2 +-
 lib/subunit/setup.py                               |    5 +-
 lib/testtools/LICENSE                              |    1 +
 lib/testtools/NEWS                                 |   52 ++++++++
 lib/testtools/doc/for-framework-folk.rst           |   11 ++
 lib/testtools/doc/for-test-authors.rst             |    2 +-
 lib/testtools/setup.py                             |    4 +-
 lib/testtools/testtools/__init__.py                |    2 +-
 lib/testtools/testtools/content.py                 |   19 ++-
 lib/testtools/testtools/matchers/_higherorder.py   |   20 +++
 lib/testtools/testtools/run.py                     |   35 ++++-
 lib/testtools/testtools/testresult/doubles.py      |   18 +++
 lib/testtools/testtools/testresult/real.py         |  136 +++++++++++++++-----
 lib/testtools/testtools/tests/helpers.py           |    4 +
 .../testtools/tests/matchers/test_higherorder.py   |   33 +++++
 lib/testtools/testtools/tests/test_content.py      |   35 +++++
 lib/testtools/testtools/tests/test_distutilscmd.py |   21 ++--
 lib/testtools/testtools/tests/test_run.py          |   46 ++++++-
 lib/testtools/testtools/tests/test_testresult.py   |   55 ++++++++
 lib/testtools/testtools/tests/test_testsuite.py    |   32 +++++-
 lib/testtools/testtools/testsuite.py               |   40 ++++++-
 32 files changed, 604 insertions(+), 75 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/subunit/INSTALL b/lib/subunit/INSTALL
index 2a053d8..eeea734 100644
--- a/lib/subunit/INSTALL
+++ b/lib/subunit/INSTALL
@@ -14,7 +14,7 @@ Dependencies
 * Python for the filters
 * 'testtools' (On Debian and Ubuntu systems the 'python-testtools' package,
   the testtools package on pypi, or https://launchpad.net/testtools) for
-  the extended test API which permits attachments. Version 0.9.11 or newer is 
+  the extended test API which permits attachments. Version 0.9.23 or newer is 
   required. Of particular note, http://testtools.python-hosting.com/ is not
   the testtools you want.
 * A C compiler for the C bindings
diff --git a/lib/subunit/MANIFEST.in b/lib/subunit/MANIFEST.in
index 7c449cf..eb98981 100644
--- a/lib/subunit/MANIFEST.in
+++ b/lib/subunit/MANIFEST.in
@@ -16,6 +16,5 @@ exclude missing
 prune perl
 exclude py-compile
 prune shell
-prune python/iso8601
 exclude stamp-h1
 include NEWS
diff --git a/lib/subunit/Makefile.am b/lib/subunit/Makefile.am
index 310c042..da16020 100644
--- a/lib/subunit/Makefile.am
+++ b/lib/subunit/Makefile.am
@@ -35,6 +35,7 @@ EXTRA_DIST =  \
 	python/subunit/tests/test_test_protocol.py \
 	python/subunit/tests/test_test_results.py \
 	runtests.py \
+	setup.py \
 	shell/README \
 	shell/share/subunit.sh \
 	shell/subunit-ui.patch \
@@ -48,8 +49,10 @@ include_subunitdir = $(includedir)/subunit
 dist_bin_SCRIPTS = \
 	filters/subunit-filter \
 	filters/subunit-ls \
+	filters/subunit-notify \
 	filters/subunit-stats \
 	filters/subunit-tags \
+	filters/subunit2csv \
 	filters/subunit2gtk \
 	filters/subunit2junitxml \
 	filters/subunit2pyunit \
diff --git a/lib/subunit/NEWS b/lib/subunit/NEWS
index f28ec5a..081dc5d 100644
--- a/lib/subunit/NEWS
+++ b/lib/subunit/NEWS
@@ -5,12 +5,25 @@ subunit release notes
 NEXT (In development)
 ---------------------
 
+0.0.9
+-----
+
 BUG FIXES
 ~~~~~~~~~
 
+* All the source files are now included in the distribution tarball.
+  (Arfrever Frehtes Taifersar Arahesis, Robert Collins, #996275)
+
 * ``python/subunit/tests/test_run.py`` and ``python/subunit/filters.py`` were
   not included in the 0.0.8 tarball. (Robert Collins)
 
+* Test ids which include non-ascii unicode characters are now supported.
+  (Robert Collins, #1029866)
+
+* The ``failfast`` option to ``subunit.run`` will now work. The dependency on
+  testtools has been raised to 0.9.23 to permit this.
+  (Robert Collins, #1090582)
+
 0.0.8
 -----
 
diff --git a/lib/subunit/README b/lib/subunit/README
index 4818a05..103a32c 100644
--- a/lib/subunit/README
+++ b/lib/subunit/README
@@ -43,6 +43,7 @@ A number of useful things can be done easily with subunit:
 
 Subunit supplies the following filters:
  * tap2subunit - convert perl's TestAnythingProtocol to subunit.
+ * subunit2csv - convert a subunit stream to csv.
  * subunit2pyunit - convert a subunit stream to pyunit test results.
  * subunit2gtk - show a subunit stream in GTK.
  * subunit2junitxml - convert a subunit stream to JUnit's XML format.
@@ -214,3 +215,15 @@ to indicate a test that errored in some expected fashion (also know as "TODO"
 tests in some frameworks). uxsuccess is used to indicate and unexpected success
 where a test though to be failing actually passes. It is complementary to
 xfail.
+
+Hacking on subunit
+------------------
+
+Releases
+========
+
+* Update versions in configure.ac and python/subunit/__init__.py.
+* Make PyPI and regular tarball releases. Upload the regular one to LP, the
+  PyPI one to PyPI.
+* Push a tagged commit.
+
diff --git a/lib/subunit/configure.ac b/lib/subunit/configure.ac
index 223b3c9..cf21d55 100644
--- a/lib/subunit/configure.ac
+++ b/lib/subunit/configure.ac
@@ -1,6 +1,6 @@
 m4_define([SUBUNIT_MAJOR_VERSION], [0])
 m4_define([SUBUNIT_MINOR_VERSION], [0])
-m4_define([SUBUNIT_MICRO_VERSION], [8])
+m4_define([SUBUNIT_MICRO_VERSION], [9])
 m4_define([SUBUNIT_VERSION],
 m4_defn([SUBUNIT_MAJOR_VERSION]).m4_defn([SUBUNIT_MINOR_VERSION]).m4_defn([SUBUNIT_MICRO_VERSION]))
 AC_PREREQ([2.59])
diff --git a/lib/subunit/python/subunit/__init__.py b/lib/subunit/python/subunit/__init__.py
index 6015c0e..42dcf29 100644
--- a/lib/subunit/python/subunit/__init__.py
+++ b/lib/subunit/python/subunit/__init__.py
@@ -147,6 +147,19 @@ from testtools import testresult
 
 from subunit import chunked, details, iso8601, test_results
 
+# same format as sys.version_info: "A tuple containing the five components of
+# the version number: major, minor, micro, releaselevel, and serial. All
+# values except releaselevel are integers; the release level is 'alpha',
+# 'beta', 'candidate', or 'final'. The version_info value corresponding to the
+# Python version 2.0 is (2, 0, 0, 'final', 0)."  Additionally we use a
+# releaselevel of 'dev' for unreleased under-development code.
+#
+# If the releaselevel is 'alpha' then the major/minor/micro components are not
+# established at this point, and setup.py will use a version of next-$(revno).
+# If the releaselevel is 'final', then the tarball will be major.minor.micro.
+# Otherwise it is major.minor.micro~$(revno).
+
+__version__ = (0, 0, 9, 'final', 0)
 
 PROGRESS_SET = 0
 PROGRESS_CUR = 1
@@ -636,6 +649,8 @@ class TestProtocolClient(testresult.TestResult):
             to subunit.Content objects.
         """
         self._addOutcome("error", test, error=error, details=details)
+        if self.failfast:
+            self.stop()
 
     def addExpectedFailure(self, test, error=None, details=None):
         """Report an expected failure in test test.
@@ -666,6 +681,8 @@ class TestProtocolClient(testresult.TestResult):
             to subunit.Content objects.
         """
         self._addOutcome("failure", test, error=error, details=details)
+        if self.failfast:
+            self.stop()
 
     def _addOutcome(self, outcome, test, error=None, details=None,
         error_permitted=True):
@@ -685,7 +702,7 @@ class TestProtocolClient(testresult.TestResult):
         :param error_permitted: If True then one and only one of error or
             details must be supplied. If False then error must not be supplied
             and details is still optional.  """
-        self._stream.write(_b("%s: %s" % (outcome, test.id())))
+        self._stream.write(_b("%s: " % outcome) + self._test_id(test))
         if error_permitted:
             if error is None and details is None:
                 raise ValueError
@@ -730,11 +747,19 @@ class TestProtocolClient(testresult.TestResult):
         """
         self._addOutcome("uxsuccess", test, details=details,
             error_permitted=False)
+        if self.failfast:
+            self.stop()
+
+    def _test_id(self, test):
+        result = test.id()
+        if type(result) is not bytes:
+            result = result.encode('utf8')
+        return result
 
     def startTest(self, test):
         """Mark a test as starting its test run."""
         super(TestProtocolClient, self).startTest(test)
-        self._stream.write(_b("test: %s\n" % test.id()))
+        self._stream.write(_b("test: ") + self._test_id(test) + _b("\n"))
         self._stream.flush()
 
     def stopTest(self, test):
diff --git a/lib/subunit/python/subunit/run.py b/lib/subunit/python/subunit/run.py
index ca5fe5c..b5ccea4 100755
--- a/lib/subunit/python/subunit/run.py
+++ b/lib/subunit/python/subunit/run.py
@@ -34,13 +34,22 @@ from testtools.run import (
 
 
 class SubunitTestRunner(object):
-    def __init__(self, stream=sys.stdout):
-        self.stream = stream
+    def __init__(self, verbosity=None, failfast=None, buffer=None, stream=None):
+        """Create a TestToolsTestRunner.
+
+        :param verbosity: Ignored.
+        :param failfast: Stop running tests at the first failure.
+        :param buffer: Ignored.
+        """
+        self.failfast = failfast
+        self.stream = stream or sys.stdout
 
     def run(self, test):
         "Run the given test case or test suite."
         result = TestProtocolClient(self.stream)
         result = AutoTimingTestResultDecorator(result)
+        if self.failfast is not None:
+            result.failfast = self.failfast
         test(result)
         return result
 
@@ -70,6 +79,6 @@ class SubunitTestProgram(TestProgram):
 
 if __name__ == '__main__':
     stream = get_default_formatter()
-    runner = SubunitTestRunner(stream)
+    runner = SubunitTestRunner
     SubunitTestProgram(module=None, argv=sys.argv, testRunner=runner,
         stdout=sys.stdout)
diff --git a/lib/subunit/python/subunit/test_results.py b/lib/subunit/python/subunit/test_results.py
index c00a2d3..91c9bbd 100644
--- a/lib/subunit/python/subunit/test_results.py
+++ b/lib/subunit/python/subunit/test_results.py
@@ -78,6 +78,13 @@ class TestResultDecorator(object):
     def addUnexpectedSuccess(self, test, details=None):
         return self.decorated.addUnexpectedSuccess(test, details=details)
 
+    def _get_failfast(self):
+        return getattr(self.decorated, 'failfast', False)
+
+    def _set_failfast(self, value):
+        self.decorated.failfast = value
+    failfast = property(_get_failfast, _set_failfast)
+
     def progress(self, offset, whence):
         return self.decorated.progress(offset, whence)
 
diff --git a/lib/subunit/python/subunit/tests/test_test_protocol.py b/lib/subunit/python/subunit/tests/test_test_protocol.py
index ec6830d..7831ba1 100644
--- a/lib/subunit/python/subunit/tests/test_test_protocol.py
+++ b/lib/subunit/python/subunit/tests/test_test_protocol.py
@@ -18,7 +18,7 @@ import datetime
 import unittest
 import os
 
-from testtools import skipIf, TestCase, TestResult
+from testtools import PlaceHolder, skipIf, TestCase, TestResult
 from testtools.compat import _b, _u, BytesIO
 from testtools.content import Content, TracebackContent, text_content
 from testtools.content_type import ContentType
@@ -1133,6 +1133,7 @@ class TestTestProtocolClient(unittest.TestCase):
     def setUp(self):
         self.io = BytesIO()
         self.protocol = subunit.TestProtocolClient(self.io)
+        self.unicode_test = PlaceHolder(_u('\u2603'))
         self.test = TestTestProtocolClient("test_start_test")
         self.sample_details = {'something':Content(
             ContentType('text', 'plain'), lambda:[_b('serialised\nform')])}
@@ -1145,6 +1146,12 @@ class TestTestProtocolClient(unittest.TestCase):
         self.protocol.startTest(self.test)
         self.assertEqual(self.io.getvalue(), _b("test: %s\n" % self.test.id()))
 
+    def test_start_test_unicode_id(self):
+        """Test startTest on a TestProtocolClient."""
+        self.protocol.startTest(self.unicode_test)
+        expected = _b("test: ") + _u('\u2603').encode('utf8') + _b("\n")
+        self.assertEqual(expected, self.io.getvalue())
+
     def test_stop_test(self):
         # stopTest doesn't output anything.
         self.protocol.stopTest(self.test)
@@ -1156,6 +1163,12 @@ class TestTestProtocolClient(unittest.TestCase):
         self.assertEqual(
             self.io.getvalue(), _b("successful: %s\n" % self.test.id()))
 
+    def test_add_outcome_unicode_id(self):
+        """Test addSuccess on a TestProtocolClient."""
+        self.protocol.addSuccess(self.unicode_test)
+        expected = _b("successful: ") + _u('\u2603').encode('utf8') + _b("\n")
+        self.assertEqual(expected, self.io.getvalue())
+
     def test_add_success_details(self):
         """Test addSuccess on a TestProtocolClient with details."""
         self.protocol.addSuccess(self.test, details=self.sample_details)
diff --git a/lib/subunit/python/subunit/tests/test_test_results.py b/lib/subunit/python/subunit/tests/test_test_results.py
index 236dfa2..ff74b9a 100644
--- a/lib/subunit/python/subunit/tests/test_test_results.py
+++ b/lib/subunit/python/subunit/tests/test_test_results.py
@@ -61,6 +61,7 @@ class TimeCapturingResult(unittest.TestResult):
     def __init__(self):
         super(TimeCapturingResult, self).__init__()
         self._calls = []
+        self.failfast = False
 
     def time(self, a_datetime):
         self._calls.append(a_datetime)
@@ -198,6 +199,11 @@ class TestAutoTimingTestResultDecorator(unittest.TestCase):
         self.assertEqual(3, len(self.decorated._calls))
         self.assertNotEqual(None, self.decorated._calls[2])
 
+    def test_set_failfast_True(self):
+        self.assertFalse(self.decorated.failfast)
+        self.result.failfast = True
+        self.assertTrue(self.decorated.failfast)
+
 
 class TestTagCollapsingDecorator(TestCase):
 
diff --git a/lib/subunit/runtests.py b/lib/subunit/runtests.py
index 691e3b3..8ecc6cd 100755
--- a/lib/subunit/runtests.py
+++ b/lib/subunit/runtests.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3
+#!/usr/bin/env python
 # -*- Mode: python -*-
 #
 # Copyright (C) 2004 Canonical.com
diff --git a/lib/subunit/setup.py b/lib/subunit/setup.py
index a78eb99..1a0b192 100755
--- a/lib/subunit/setup.py
+++ b/lib/subunit/setup.py
@@ -9,7 +9,7 @@ except ImportError:
 else:
     extra = {
         'install_requires': [
-            'testtools>=0.9.11',
+            'testtools>=0.9.23',
         ]
     }
 
@@ -38,6 +38,7 @@ setup(
     long_description=open('README').read(),
     classifiers=[
         'Intended Audience :: Developers',
+        'Programming Language :: Python :: 3',
         'Programming Language :: Python',
         'Topic :: Software Development :: Testing',
     ],
@@ -45,7 +46,7 @@ setup(
     author='Robert Collins',
     author_email='subunit-dev at lists.launchpad.net',
     url='http://launchpad.net/subunit',
-    packages=['subunit'],
+    packages=['subunit', 'subunit.tests'],
     package_dir={'subunit': 'python/subunit'},
     scripts = [
         'filters/subunit2gtk',
diff --git a/lib/testtools/LICENSE b/lib/testtools/LICENSE
index 42421b0..d59dc7c 100644
--- a/lib/testtools/LICENSE
+++ b/lib/testtools/LICENSE
@@ -16,6 +16,7 @@ The testtools authors are:
  * Christian Kampka
  * Gavin Panella
  * Martin Pool
+ * Vincent Ladeuil
 
 and are collectively referred to as "testtools developers".
 
diff --git a/lib/testtools/NEWS b/lib/testtools/NEWS
index 9b0ac8b..6f3cb8c 100644
--- a/lib/testtools/NEWS
+++ b/lib/testtools/NEWS
@@ -6,6 +6,58 @@ Changes and improvements to testtools_, grouped by release.
 NEXT
 ~~~~
 
+0.9.24
+~~~~~~
+
+Changes
+-------
+
+* ``testtools.run discover`` will now sort the tests it discovered. This is a 
+  workaround for http://bugs.python.org/issue16709. Non-standard test suites
+  are preserved, and their ``sort_tests()`` method called (if they have such an
+  attribute). ``testtools.testsuite.sorted_tests(suite, True)`` can be used by
+  such suites to do a local sort. (Robert Collins, #1091512)
+
+* ``ThreadsafeForwardingResult`` now defines a stub ``progress`` method, which
+  fixes ``testr run`` of streams containing progress markers (by discarding the 
+  progress data). (Robert Collins, #1019165)
+
+0.9.23
+~~~~~~
+
+Changes
+-------
+
+* ``run.TestToolsTestRunner`` now accepts the verbosity, buffer and failfast
+  arguments the upstream python TestProgram code wants to give it, making it
+  possible to support them in a compatible fashion. (Robert Collins)
+
+Improvements
+------------
+
+* ``testtools.run`` now supports the ``-f`` or ``--failfast`` parameter.
+  Previously it was advertised in the help but ignored.
+  (Robert Collins, #1090582)
+
+* ``AnyMatch`` added, a new matcher that matches when any item in a collection
+  matches the given matcher.  (Jonathan Lange)
+
+* Spelling corrections to documentation.  (Vincent Ladeuil)
+
+* ``TestProgram`` now has a sane default for its ``testRunner`` argument.
+  (Vincent Ladeuil)
+
+* The test suite passes on Python 3 again. (Robert Collins)
+
+0.9.22
+~~~~~~
+
+Improvements
+------------
+
+* ``content_from_file`` and ``content_from_stream`` now accept seek_offset and
+  seek_whence parameters allowing them to be used to grab less than the full
+  stream, or to be used with StringIO streams. (Robert Collins, #1088693)
 
 0.9.21
 ~~~~~~
diff --git a/lib/testtools/doc/for-framework-folk.rst b/lib/testtools/doc/for-framework-folk.rst
index ff9e71e..ecc11f3 100644
--- a/lib/testtools/doc/for-framework-folk.rst
+++ b/lib/testtools/doc/for-framework-folk.rst
@@ -222,6 +222,17 @@ A test suite that sets up a fixture_ before running any tests, and then tears
 it down after all of the tests are run. The fixture is *not* made available to
 any of the tests.
 
+sorted_tests
+------------
+
+Given the composite structure of TestSuite / TestCase, sorting tests is
+problematic - you can't tell what functionality is embedded into custom Suite
+implementations. In order to deliver consistent test orders when using test
+discovery (see http://bugs.python.org/issue16709), testtools flattens and
+sorts tests that have the standard TestSuite, defines a new method sort_tests,
+which can be used by non-standard TestSuites to know when they should sort
+their tests.
+
 .. _`testtools API docs`: http://mumak.net/testtools/apidocs/
 .. _unittest: http://docs.python.org/library/unittest.html
 .. _fixture: http://pypi.python.org/pypi/fixtures
diff --git a/lib/testtools/doc/for-test-authors.rst b/lib/testtools/doc/for-test-authors.rst
index b83221b..c9e6c6a 100644
--- a/lib/testtools/doc/for-test-authors.rst
+++ b/lib/testtools/doc/for-test-authors.rst
@@ -432,7 +432,7 @@ example::
   def test_keys_equal(self):
       x = {'a': 1, 'b': 2}
       y = {'a': 2, 'b': 3}
-      self.assertThat(a, KeysEqual(b))
+      self.assertThat(x, KeysEqual(y))
 
 
 MatchesRegex
diff --git a/lib/testtools/setup.py b/lib/testtools/setup.py
index 47d7835..7ecd6d2 100755
--- a/lib/testtools/setup.py
+++ b/lib/testtools/setup.py
@@ -71,7 +71,9 @@ setup(name='testtools',
                    'framework'),
       long_description=get_long_description(),
       version=get_version(),
-      classifiers=["License :: OSI Approved :: MIT License"],
+      classifiers=["License :: OSI Approved :: MIT License",
+        "Programming Language :: Python :: 3",
+        ],
       packages=[
         'testtools',
         'testtools.matchers',
diff --git a/lib/testtools/testtools/__init__.py b/lib/testtools/testtools/__init__.py
index 7cf0775..d722ce5 100644
--- a/lib/testtools/testtools/__init__.py
+++ b/lib/testtools/testtools/__init__.py
@@ -86,4 +86,4 @@ from testtools.distutilscmd import (
 # If the releaselevel is 'final', then the tarball will be major.minor.micro.
 # Otherwise it is major.minor.micro~$(revno).
 
-__version__ = (0, 9, 22, 'dev', 0)
+__version__ = (0, 9, 25, 'dev', 0)
diff --git a/lib/testtools/testtools/content.py b/lib/testtools/testtools/content.py
index de60950..8bd4a22 100644
--- a/lib/testtools/testtools/content.py
+++ b/lib/testtools/testtools/content.py
@@ -33,12 +33,16 @@ STDOUT_LINE = '\nStdout:\n%s'
 STDERR_LINE = '\nStderr:\n%s'
 
 
-def _iter_chunks(stream, chunk_size):
+def _iter_chunks(stream, chunk_size, seek_offset=None, seek_whence=0):


-- 
Samba Shared Repository


More information about the samba-cvs mailing list