Hello community, here is the log from the commit of package python-testtools for openSUSE:Factory checked in at 2014-01-29 22:22:10 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-testtools (Old) and /work/SRC/openSUSE:Factory/.python-testtools.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-testtools" Changes: -------- --- /work/SRC/openSUSE:Factory/python-testtools/python-testtools.changes 2014-01-16 15:13:13.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.python-testtools.new/python-testtools.changes 2014-01-29 22:22:11.000000000 +0100 @@ -1,0 +2,11 @@ +Wed Jan 29 12:31:27 UTC 2014 - [email protected] + +- update to 0.9.35: + * Removed a number of code paths where Python 2.4 and Python 2.5 were + explicitly handled. (Daniel Watkins) + * Added the ``testtools.TestCase.expectThat`` method, which implements + delayed assertions. (Thomi Richards) + * Docs are now built as part of the Travis-CI build, reducing the chance of + Read The Docs being broken accidentally. (Daniel Watkins, #1158773) + +------------------------------------------------------------------- Old: ---- testtools-0.9.34.tar.gz New: ---- testtools-0.9.35.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-testtools.spec ++++++ --- /var/tmp/diff_new_pack.CwiPVL/_old 2014-01-29 22:22:12.000000000 +0100 +++ /var/tmp/diff_new_pack.CwiPVL/_new 2014-01-29 22:22:12.000000000 +0100 @@ -21,7 +21,7 @@ %bcond_with tests Name: python-testtools -Version: 0.9.34 +Version: 0.9.35 Release: 0 Summary: Extensions to the Python Standard Library Unit Testing Framework License: MIT ++++++ testtools-0.9.34.tar.gz -> testtools-0.9.35.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/testtools-0.9.34/.gitignore new/testtools-0.9.35/.gitignore --- old/testtools-0.9.34/.gitignore 2013-02-15 07:18:19.000000000 +0100 +++ new/testtools-0.9.35/.gitignore 2014-01-29 10:53:34.000000000 +0100 @@ -8,6 +8,7 @@ _trial_temp doc/_build .testrepository +.lp_creds ./testtools.egg-info *.pyc *.swp diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/testtools-0.9.34/NEWS new/testtools-0.9.35/NEWS --- old/testtools-0.9.34/NEWS 2013-11-30 01:57:16.000000000 +0100 +++ new/testtools-0.9.35/NEWS 2014-01-29 10:59:38.000000000 +0100 @@ -7,6 +7,24 @@ NEXT ~~~~ +0.9.35 +~~~~~~ + +Changes +------- + +* Removed a number of code paths where Python 2.4 and Python 2.5 were + explicitly handled. (Daniel Watkins) + +Improvements +------------ + +* Added the ``testtools.TestCase.expectThat`` method, which implements + delayed assertions. (Thomi Richards) + +* Docs are now built as part of the Travis-CI build, reducing the chance of + Read The Docs being broken accidentally. (Daniel Watkins, #1158773) + 0.9.34 ~~~~~~ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/testtools-0.9.34/PKG-INFO new/testtools-0.9.35/PKG-INFO --- old/testtools-0.9.34/PKG-INFO 2013-11-30 02:00:56.000000000 +0100 +++ new/testtools-0.9.35/PKG-INFO 2014-01-29 11:01:53.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: testtools -Version: 0.9.34 +Version: 0.9.35 Summary: Extensions to the Python standard library unit testing framework Home-page: https://github.com/testing-cabal/testtools Author: Jonathan M. Lange Files old/testtools-0.9.34/doc/.hacking.rst.swp and new/testtools-0.9.35/doc/.hacking.rst.swp differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/testtools-0.9.34/doc/for-test-authors.rst new/testtools-0.9.35/doc/for-test-authors.rst --- old/testtools-0.9.34/doc/for-test-authors.rst 2013-11-28 09:28:37.000000000 +0100 +++ new/testtools-0.9.35/doc/for-test-authors.rst 2014-01-29 10:53:19.000000000 +0100 @@ -288,6 +288,43 @@ self.assertNotEqual(result, 50) +Delayed Assertions +~~~~~~~~~~~~~~~~~~ + +A failure in the ``self.assertThat`` method will immediately fail the test: No +more test code will be run after the assertion failure. + +The ``expectThat`` method behaves the same as ``assertThat`` with one +exception: when failing the test it does so at the end of the test code rather +than when the mismatch is detected. For example:: + + import subprocess + + from testtools import TestCase + from testtools.matchers import Equals + + + class SomeProcessTests(TestCase): + + def test_process_output(self): + process = subprocess.Popen( + ["my-app", "/some/path"], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE + ) + + stdout, stderrr = process.communicate() + + self.expectThat(process.returncode, Equals(0)) + self.expectThat(stdout, Equals("Expected Output")) + self.expectThat(stderr, Equals("")) + +In this example, should the ``expectThat`` call fail, the failure will be +recorded in the test result, but the test will continue as normal. If all +three assertions fail, the test result will have three failures recorded, and +the failure details for each failed assertion will be attached to the test +result. + Stock matchers -------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/testtools-0.9.34/testtools/__init__.py new/testtools-0.9.35/testtools/__init__.py --- old/testtools-0.9.34/testtools/__init__.py 2013-11-30 01:56:29.000000000 +0100 +++ new/testtools-0.9.35/testtools/__init__.py 2014-01-29 10:59:30.000000000 +0100 @@ -122,4 +122,4 @@ # If the releaselevel is 'final', then the tarball will be major.minor.micro. # Otherwise it is major.minor.micro~$(revno). -__version__ = (0, 9, 34, 'final', 0) +__version__ = (0, 9, 35, 'final', 0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/testtools-0.9.34/testtools/compat.py new/testtools-0.9.35/testtools/compat.py --- old/testtools-0.9.34/testtools/compat.py 2013-11-24 03:32:31.000000000 +0100 +++ new/testtools-0.9.35/testtools/compat.py 2014-01-29 10:53:19.000000000 +0100 @@ -88,34 +88,6 @@ _u.__doc__ = __u_doc -if sys.version_info > (2, 5): - all = all - _error_repr = BaseException.__repr__ - def isbaseexception(exception): - """Return whether exception inherits from BaseException only""" - return (isinstance(exception, BaseException) - and not isinstance(exception, Exception)) -else: - def all(iterable): - """If contents of iterable all evaluate as boolean True""" - for obj in iterable: - if not obj: - return False - return True - def _error_repr(exception): - """Format an exception instance as Python 2.5 and later do""" - return exception.__class__.__name__ + repr(exception.args) - def isbaseexception(exception): - """Return whether exception would inherit from BaseException only - - This approximates the hierarchy in Python 2.5 and later, compare the - difference between the diagrams at the bottom of the pages: - <http://docs.python.org/release/2.4.4/lib/module-exceptions.html> - <http://docs.python.org/release/2.5.4/lib/module-exceptions.html> - """ - return isinstance(exception, (KeyboardInterrupt, SystemExit)) - - # GZ 2011-08-24: Using isinstance checks like this encourages bad interfaces, # there should be better ways to write code needing this. if not issubclass(getattr(builtins, "bytes", str), str): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/testtools-0.9.34/testtools/content.py new/testtools-0.9.35/testtools/content.py --- old/testtools-0.9.34/testtools/content.py 2013-11-28 09:28:37.000000000 +0100 +++ new/testtools-0.9.35/testtools/content.py 2014-01-29 10:53:19.000000000 +0100 @@ -112,18 +112,12 @@ def _iter_text(self): """Worker for iter_text - does the decoding.""" encoding = self.content_type.parameters.get('charset', 'ISO-8859-1') - try: - # 2.5+ - decoder = codecs.getincrementaldecoder(encoding)() - for bytes in self.iter_bytes(): - yield decoder.decode(bytes) - final = decoder.decode(_b(''), True) - if final: - yield final - except AttributeError: - # < 2.5 - bytes = ''.join(self.iter_bytes()) - yield bytes.decode(encoding) + decoder = codecs.getincrementaldecoder(encoding)() + for bytes in self.iter_bytes(): + yield decoder.decode(bytes) + final = decoder.decode(_b(''), True) + if final: + yield final def __repr__(self): return "<Content type=%r, value=%r>" % ( @@ -299,13 +293,12 @@ if content_type is None: content_type = UTF8_TEXT def reader(): - # This should be try:finally:, but python2.4 makes that hard. When - # We drop older python support we can make this use a context manager - # for maximum simplicity. - stream = open(path, 'rb') - for chunk in _iter_chunks(stream, chunk_size, seek_offset, seek_whence): - yield chunk - stream.close() + with open(path, 'rb') as stream: + for chunk in _iter_chunks(stream, + chunk_size, + seek_offset, + seek_whence): + yield chunk return content_from_reader(reader, content_type, buffer_now) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/testtools-0.9.34/testtools/matchers/_exception.py new/testtools-0.9.35/testtools/matchers/_exception.py --- old/testtools-0.9.34/testtools/matchers/_exception.py 2013-04-03 07:55:59.000000000 +0200 +++ new/testtools-0.9.35/testtools/matchers/_exception.py 2014-01-29 10:53:19.000000000 +0100 @@ -10,8 +10,6 @@ from testtools.compat import ( classtypes, - _error_repr, - isbaseexception, istext, ) from ._basic import MatchesRegex @@ -22,6 +20,17 @@ ) +_error_repr = BaseException.__repr__ + + +def _is_exception(exc): + return isinstance(exc, BaseException) + + +def _is_user_exception(exc): + return isinstance(exc, Exception) + + class MatchesException(Matcher): """Match an exc_info tuple against an exception instance or type.""" @@ -45,7 +54,7 @@ value_re = AfterPreproccessing(str, MatchesRegex(value_re), False) self.value_re = value_re expected_type = type(self.expected) - self._is_instance = not any(issubclass(expected_type, class_type) + self._is_instance = not any(issubclass(expected_type, class_type) for class_type in classtypes() + (tuple,)) def match(self, other): @@ -103,9 +112,10 @@ else: mismatch = None # The exception did not match, or no explicit matching logic was - # performed. If the exception is a non-user exception (that is, not - # a subclass of Exception on Python 2.5+) then propogate it. - if isbaseexception(exc_info[1]): + # performed. If the exception is a non-user exception then + # propagate it. + exception = exc_info[1] + if _is_exception(exception) and not _is_user_exception(exception): del exc_info raise return mismatch diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/testtools-0.9.34/testtools/matchers/_impl.py new/testtools-0.9.35/testtools/matchers/_impl.py --- old/testtools-0.9.34/testtools/matchers/_impl.py 2013-01-26 18:18:27.000000000 +0100 +++ new/testtools-0.9.35/testtools/matchers/_impl.py 2014-01-29 10:53:19.000000000 +0100 @@ -114,9 +114,7 @@ # characters are in the matchee, matcher or mismatch. def __init__(self, matchee, matcher, mismatch, verbose=False): - # Have to use old-style upcalling for Python 2.4 and 2.5 - # compatibility. - AssertionError.__init__(self) + super(MismatchError, self).__init__() self.matchee = matchee self.matcher = matcher self.mismatch = mismatch diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/testtools-0.9.34/testtools/testcase.py new/testtools-0.9.35/testtools/testcase.py --- old/testtools-0.9.34/testtools/testcase.py 2013-11-28 09:28:37.000000000 +0100 +++ new/testtools-0.9.35/testtools/testcase.py 2014-01-29 10:53:19.000000000 +0100 @@ -200,9 +200,6 @@ (_UnexpectedSuccess, self._report_unexpected_success), (Exception, self._report_error), ] - if sys.version_info < (2, 6): - # Catch old-style string exceptions with None as the instance - self.exception_handlers.append((type(None), self._report_error)) def __eq__(self, other): eq = getattr(unittest.TestCase, '__eq__', None) @@ -404,14 +401,9 @@ :param matcher: An object meeting the testtools.Matcher protocol. :raises MismatchError: When matcher does not match thing. """ - matcher = Annotate.if_message(message, matcher) - mismatch = matcher.match(matchee) - if not mismatch: - return - existing_details = self.getDetails() - for (name, content) in mismatch.get_details().items(): - self.addDetailUniqueName(name, content) - raise MismatchError(matchee, matcher, mismatch, verbose) + mismatch_error = self._matchHelper(matchee, matcher, message, verbose) + if mismatch_error is not None: + raise mismatch_error def addDetailUniqueName(self, name, content_object): """Add a detail to the test, but ensure it's name is unique. @@ -434,6 +426,38 @@ suffix += 1 self.addDetail(full_name, content_object) + def expectThat(self, matchee, matcher, message='', verbose=False): + """Check that matchee is matched by matcher, but delay the assertion failure. + + This method behaves similarly to ``assertThat``, except that a failed + match does not exit the test immediately. The rest of the test code will + continue to run, and the test will be marked as failing after the test + has finished. + + :param matchee: An object to match with matcher. + :param matcher: An object meeting the testtools.Matcher protocol. + :param message: If specified, show this message with any failed match. + """ + mismatch_error = self._matchHelper(matchee, matcher, message, verbose) + + if mismatch_error is not None: + self.addDetailUniqueName( + "Failed expectation", + content.StacktraceContent( + postfix_content="MismatchError: " + str(mismatch_error) + ) + ) + self.force_failure = True + + def _matchHelper(self, matchee, matcher, message, verbose): + matcher = Annotate.if_message(message, matcher) + mismatch = matcher.match(matchee) + if not mismatch: + return + for (name, value) in mismatch.get_details().items(): + self.addDetailUniqueName(name, value) + return MismatchError(matchee, matcher, mismatch, verbose) + def defaultTestResult(self): return TestResult() @@ -580,12 +604,7 @@ return ret def _get_test_method(self): - absent_attr = object() - # Python 2.5+ - method_name = getattr(self, '_testMethodName', absent_attr) - if method_name is absent_attr: - # Python 2.4 - method_name = getattr(self, '_TestCase__testMethodName') + method_name = getattr(self, '_testMethodName') return getattr(self, method_name) def _run_test_method(self, result): @@ -824,8 +843,6 @@ class ExpectedException: """A context manager to handle expected exceptions. - In Python 2.5 or later:: - def test_foo(self): with ExpectedException(ValueError, 'fo.*'): raise ValueError('foo') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/testtools-0.9.34/testtools/testresult/real.py new/testtools-0.9.35/testtools/testresult/real.py --- old/testtools-0.9.34/testtools/testresult/real.py 2013-11-28 09:28:37.000000000 +0100 +++ new/testtools-0.9.35/testtools/testresult/real.py 2014-01-29 10:53:19.000000000 +0100 @@ -31,7 +31,7 @@ parse_mime_type = try_import('mimeparse.parse_mime_type') Queue = try_imports(['Queue.Queue', 'queue.Queue']) -from testtools.compat import all, str_is_unicode, _u, _b +from testtools.compat import str_is_unicode, _u, _b from testtools.content import ( Content, text_content, @@ -325,7 +325,7 @@ mime_type=None, route_code=None, timestamp=None): """Inform the result about a test status. - :param test_id: The test whose status is being reported. None to + :param test_id: The test whose status is being reported. None to report status about the test run as a whole. :param test_status: The status for the test. There are two sorts of status - interim and final status events. As many interim events @@ -347,7 +347,7 @@ executed. Typically this is when querying what tests could be run in a test run (which is useful for selecting tests to run). * xfail - the test failed but that was expected. This is purely - informative - the test is not considered to be a failure. + informative - the test is not considered to be a failure. * uxsuccess - the test passed but was expected to fail. The test will be considered a failure. * success - the test has finished without error. @@ -388,7 +388,7 @@ class CopyStreamResult(StreamResult): """Copies all event it receives to multiple results. - + This provides an easy facility for combining multiple StreamResults. For TestResult the equivalent class was ``MultiTestResult``. @@ -413,9 +413,9 @@ class StreamFailFast(StreamResult): """Call the supplied callback if an error is seen in a stream. - + An example callback:: - + def do_something(): pass """ @@ -448,12 +448,12 @@ >>> router.status(test_id='foo', route_code='0/1', test_status='uxsuccess') StreamResultRouter has no buffering. - + When adding routes (and for the fallback) whether to call startTestRun and stopTestRun or to not call them is controllable by passing 'do_start_stop_run'. The default is to call them for the fallback only. If a route is added after startTestRun has been called, and - do_start_stop_run is True then startTestRun is called immediately on the + do_start_stop_run is True then startTestRun is called immediately on the new route sink. There is no a-priori defined lookup order for routes: if they are ambiguous @@ -523,12 +523,12 @@ :raises: ValueError if the policy is unknown :raises: TypeError if the policy is given arguments it cannot handle. - ``route_code_prefix`` routes events based on a prefix of the route - code in the event. It takes a ``route_prefix`` argument to match on - (e.g. '0') and a ``consume_route`` argument, which, if True, removes + ``route_code_prefix`` routes events based on a prefix of the route + code in the event. It takes a ``route_prefix`` argument to match on + (e.g. '0') and a ``consume_route`` argument, which, if True, removes the prefix from the ``route_code`` when forwarding events. - ``test_id`` routes events based on the test id. It takes a single + ``test_id`` routes events based on the test id. It takes a single argument, ``test_id``. Use ``None`` to select non-test events. """ policy_method = StreamResultRouter._policies.get(policy, None) @@ -649,7 +649,7 @@ # notify completed tests. if test_status not in (None, 'inprogress'): self.on_test(self._inprogress.pop(key)) - + def stopTestRun(self): super(StreamToDict, self).stopTestRun() while self._inprogress: @@ -700,7 +700,7 @@ class StreamSummary(StreamToDict): """A specialised StreamResult that summarises a stream. - + The summary uses the same representation as the original unittest.TestResult contract, allowing it to be consumed by any test runner. @@ -774,7 +774,7 @@ class TestControl(object): """Controls a running test run, allowing it to be interrupted. - + :ivar shouldStop: If True, tests should not run and should instead return immediately. Similarly a TestSuite should check this between each test and if set stop dispatching any new tests and return. @@ -1285,7 +1285,7 @@ class ExtendedToStreamDecorator(CopyStreamResult, StreamSummary, TestControl): """Permit using old TestResult API code with new StreamResult objects. - + This decorates a StreamResult and converts old (Python 2.6 / 2.7 / Extended) TestResult API calls into StreamResult calls. @@ -1477,7 +1477,7 @@ queue immediately. Events are forwarded as a dict with a key ``event`` which is one of - ``startTestRun``, ``stopTestRun`` or ``status``. When ``event`` is + ``startTestRun``, ``stopTestRun`` or ``status``. When ``event`` is ``status`` the dict also has keys matching the keyword arguments of ``StreamResult.status``, otherwise it has one other key ``result`` which is the result that invoked ``startTestRun``. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/testtools-0.9.34/testtools/tests/matchers/test_exception.py new/testtools-0.9.35/testtools/tests/matchers/test_exception.py --- old/testtools-0.9.34/testtools/tests/matchers/test_exception.py 2013-01-26 18:18:27.000000000 +0100 +++ new/testtools-0.9.35/testtools/tests/matchers/test_exception.py 2014-01-29 10:53:19.000000000 +0100 @@ -163,12 +163,7 @@ # Exception, it is propogated. match_keyb = Raises(MatchesException(KeyboardInterrupt)) def raise_keyb_from_match(): - if sys.version_info > (2, 5): - matcher = Raises(MatchesException(Exception)) - else: - # On Python 2.4 KeyboardInterrupt is a StandardError subclass - # but should propogate from less generic exception matchers - matcher = Raises(MatchesException(EnvironmentError)) + matcher = Raises(MatchesException(Exception)) matcher.match(self.raiser) self.assertThat(raise_keyb_from_match, match_keyb) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/testtools-0.9.34/testtools/tests/test_spinner.py new/testtools-0.9.35/testtools/tests/test_spinner.py --- old/testtools-0.9.34/testtools/tests/test_spinner.py 2013-11-28 09:28:37.000000000 +0100 +++ new/testtools-0.9.35/testtools/tests/test_spinner.py 2014-01-29 10:53:19.000000000 +0100 @@ -245,14 +245,7 @@ timeout = self.make_timeout() spinner = self.make_spinner(reactor) spinner.run(timeout, reactor.callInThread, time.sleep, timeout / 2.0) - # Python before 2.5 has a race condition with thread handling where - # join() does not remove threads from enumerate before returning - the - # thread being joined does the removal. This was fixed in Python 2.5 - # but we still support 2.4, so we have to workaround the issue. - # http://bugs.python.org/issue1703448. - self.assertThat( - [thread for thread in threading.enumerate() if thread.isAlive()], - Equals(current_threads)) + self.assertThat(list(threading.enumerate()), Equals(current_threads)) def test_leftover_junk_available(self): # If 'run' is given a function that leaves the reactor dirty in some diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/testtools-0.9.34/testtools/tests/test_testcase.py new/testtools-0.9.35/testtools/tests/test_testcase.py --- old/testtools-0.9.34/testtools/tests/test_testcase.py 2013-11-28 09:28:37.000000000 +0100 +++ new/testtools-0.9.35/testtools/tests/test_testcase.py 2014-01-29 10:53:19.000000000 +0100 @@ -569,6 +569,38 @@ self.assertFails( expected, self.assertThat, matchee, matcher, verbose=True) + def test_expectThat_matches_clean(self): + class Matcher(object): + def match(self, foo): + return None + self.expectThat("foo", Matcher()) + + def test_expectThat_mismatch_fails_test(self): + class Test(TestCase): + def test(self): + self.expectThat("foo", Equals("bar")) + result = Test("test").run() + self.assertFalse(result.wasSuccessful()) + + def test_expectThat_does_not_exit_test(self): + class Test(TestCase): + marker = False + def test(self): + self.expectThat("foo", Equals("bar")) + Test.marker = True + result = Test("test").run() + self.assertFalse(result.wasSuccessful()) + self.assertTrue(Test.marker) + + def test_expectThat_adds_detail(self): + class Test(TestCase): + def test(self): + self.expectThat("foo", Equals("bar")) + test = Test("test") + result = test.run() + details = test.getDetails() + self.assertTrue("Failed expectation" in details) + def test__force_failure_fails_test(self): class Test(TestCase): def test_foo(self): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/testtools-0.9.34/testtools/tests/test_testresult.py new/testtools-0.9.35/testtools/tests/test_testresult.py --- old/testtools-0.9.34/testtools/tests/test_testresult.py 2013-11-28 09:28:37.000000000 +0100 +++ new/testtools-0.9.35/testtools/tests/test_testresult.py 2014-01-29 10:53:19.000000000 +0100 @@ -844,7 +844,7 @@ result.status(test_id='foo', test_status='fail') result.stopTestRun() self.assertEqual(False, result.wasSuccessful()) - + class TestStreamFailFast(TestCase): @@ -2381,11 +2381,6 @@ self._run(stream, module.Test()) return stream.getvalue() - def _silence_deprecation_warnings(self): - """Shut up DeprecationWarning for this test only""" - warnings.simplefilter("ignore", DeprecationWarning) - self.addCleanup(warnings.filters.remove, warnings.filters[0]) - def _get_sample_text(self, encoding="unicode_internal"): if encoding is None and str_is_unicode: encoding = "unicode_internal" @@ -2427,7 +2422,7 @@ if sys.version_info > (3, 3): return MatchesAny(Contains("FileExistsError: "), Contains("PermissionError: ")) - elif os.name != "nt" or sys.version_info < (2, 5): + elif os.name != "nt": return Contains(self._as_output("OSError: ")) else: return Contains(self._as_output("WindowsError: ")) @@ -2491,15 +2486,6 @@ "UnprintableError: <unprintable UnprintableError object>\n"), textoutput) - def test_string_exception(self): - """Raise a string rather than an exception instance if supported""" - if sys.version_info > (2, 6): - self.skip("No string exceptions in Python 2.6 or later") - elif sys.version_info > (2, 5): - self._silence_deprecation_warnings() - textoutput = self._test_external_case(testline="raise 'plain str'") - self.assertIn(self._as_output("\nplain str\n"), textoutput) - def test_non_ascii_dirname(self): """Script paths in the traceback can be non-ascii""" text, raw = self._get_sample_text(sys.getfilesystemencoding()) @@ -2529,9 +2515,6 @@ def test_syntax_error_import_binary(self): """Importing a binary file shouldn't break SyntaxError formatting""" - if sys.version_info < (2, 5): - # Python 2.4 assumes the file is latin-1 and tells you off - self._silence_deprecation_warnings() self._setup_external_case("import bad") f = open(os.path.join(self.dir, "bad.py"), "wb") try: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/testtools-0.9.34/testtools.egg-info/PKG-INFO new/testtools-0.9.35/testtools.egg-info/PKG-INFO --- old/testtools-0.9.34/testtools.egg-info/PKG-INFO 2013-11-30 02:00:56.000000000 +0100 +++ new/testtools-0.9.35/testtools.egg-info/PKG-INFO 2014-01-29 11:01:52.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: testtools -Version: 0.9.34 +Version: 0.9.35 Summary: Extensions to the Python standard library unit testing framework Home-page: https://github.com/testing-cabal/testtools Author: Jonathan M. Lange -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
