Hello community,

here is the log from the commit of package python3-unittest2 for 
openSUSE:Factory checked in at 2015-03-19 21:12:58
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python3-unittest2 (Old)
 and      /work/SRC/openSUSE:Factory/.python3-unittest2.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python3-unittest2"

Changes:
--------
--- /work/SRC/openSUSE:Factory/python3-unittest2/python3-unittest2.changes      
2015-01-29 09:56:14.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.python3-unittest2.new/python3-unittest2.changes 
2015-03-19 21:12:59.000000000 +0100
@@ -1,0 +2,15 @@
+Sat Mar 14 01:19:35 UTC 2015 - [email protected]
+
+- update to version 1.0.1:
+  * Unittest2 issue #94: Need at least 1.4 of six.
+
+-------------------------------------------------------------------
+Fri Mar  6 19:30:27 UTC 2015 - [email protected]
+
+- specfile:
+  * added traceback2, linecache2 requirement
+
+- update to version 1.0.0:
+  * Issue #22936: Permit showing local variables in tracebacks.
+
+-------------------------------------------------------------------

Old:
----
  unittest2-0.8.0.tar.gz

New:
----
  unittest2-1.0.1.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python3-unittest2.spec ++++++
--- /var/tmp/diff_new_pack.KdMRGX/_old  2015-03-19 21:13:00.000000000 +0100
+++ /var/tmp/diff_new_pack.KdMRGX/_new  2015-03-19 21:13:00.000000000 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python3-unittest2
 #
-# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +17,7 @@
 
 
 Name:           python3-unittest2
-Version:        0.8.0
+Version:        1.0.1
 Release:        0
 Url:            http://pypi.python.org/pypi/unittest2
 Summary:        The new features in unittest for Python 2.7 backported to 
Python 2.3+
@@ -26,9 +26,13 @@
 Source:         
https://pypi.python.org/packages/source/u/unittest2/unittest2-%{version}.tar.gz
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 BuildRequires:  python3-devel
+BuildRequires:  python3-linecache2
 BuildRequires:  python3-setuptools
 BuildRequires:  python3-six
+BuildRequires:  python3-traceback2
+Requires:       python3-linecache2
 Requires:       python3-six
+Requires:       python3-traceback2
 BuildArch:      noarch
 
 %description

++++++ unittest2-0.8.0.tar.gz -> unittest2-1.0.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/unittest2-0.8.0/PKG-INFO new/unittest2-1.0.1/PKG-INFO
--- old/unittest2-0.8.0/PKG-INFO        2014-11-04 16:26:25.000000000 +0100
+++ new/unittest2-1.0.1/PKG-INFO        2015-03-12 03:56:02.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: unittest2
-Version: 0.8.0
+Version: 1.0.1
 Summary: The new features in unittest backported to Python 2.4+.
 Home-page: http://pypi.python.org/pypi/unittest2
 Author: Michael Foord
@@ -30,8 +30,9 @@
         
         * `Download unittest2 0.5.1 for Python 2.3 
<http://voidspace.org.uk/downloads/unittest2-0.5.1-python2.3.zip>`_
         
-        There is also a version of unittest2 for Python 3. This has the 
project name
-        "unittest2py3k" but uses the same package name ("unittest2"):
+        There was a separate version of unittest2 for Python 3. This is no 
longer
+        needed, but still exists on PyPI. This had the project name 
"unittest2py3k" but
+        uses the same package name ("unittest2"):
         
         * `unittest2 for Python 3 <http://pypi.python.org/pypi/unittest2py3k>`_
         
@@ -43,6 +44,11 @@
         will work with the standard unittest test loaders, runners result 
objects
         however.
         
+        In general for documentation on unittest2 see the current latest 
documented of
+        CPython:
+        
+        * `CPython unittest documentation 
<https://docs.python.org/dev/library/unittest.html>`_
+        
         New features include:
         
         * ``addCleanups`` - better resource management
@@ -169,11 +175,24 @@
         CHANGELOG
         =========
         
+        2015-03-12 - 1.0.1
+        ------------------
+        
+        - Unittest2 issue #94: Need at least 1.4 of six.
+        
+        2015-03-06 - 1.0.0
+        ------------------
+        
+        - Issue #22936: Permit showing local variables in tracebacks.
+        
         2014/11/05 - 0.8
         ----------------
         
         - Issue #22457: Honour load_tests in the start_dir of discovery.
         
+        - Issue #22894: TestCase.subTest() would cause the test suite to be 
stopped
+          when in failfast mode, even in the absence of failures.
+        
         2014/10/31 - 0.7.1
         ------------------
         
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/unittest2-0.8.0/README.txt 
new/unittest2-1.0.1/README.txt
--- old/unittest2-0.8.0/README.txt      2014-11-04 16:25:37.000000000 +0100
+++ new/unittest2-1.0.1/README.txt      2015-03-12 03:55:04.000000000 +0100
@@ -22,8 +22,9 @@
 
 * `Download unittest2 0.5.1 for Python 2.3 
<http://voidspace.org.uk/downloads/unittest2-0.5.1-python2.3.zip>`_
 
-There is also a version of unittest2 for Python 3. This has the project name
-"unittest2py3k" but uses the same package name ("unittest2"):
+There was a separate version of unittest2 for Python 3. This is no longer
+needed, but still exists on PyPI. This had the project name "unittest2py3k" but
+uses the same package name ("unittest2"):
 
 * `unittest2 for Python 3 <http://pypi.python.org/pypi/unittest2py3k>`_
 
@@ -35,6 +36,11 @@
 will work with the standard unittest test loaders, runners result objects
 however.
 
+In general for documentation on unittest2 see the current latest documented of
+CPython:
+
+* `CPython unittest documentation 
<https://docs.python.org/dev/library/unittest.html>`_
+
 New features include:
 
 * ``addCleanups`` - better resource management
@@ -161,11 +167,24 @@
 CHANGELOG
 =========
 
+2015-03-12 - 1.0.1
+------------------
+
+- Unittest2 issue #94: Need at least 1.4 of six.
+
+2015-03-06 - 1.0.0
+------------------
+
+- Issue #22936: Permit showing local variables in tracebacks.
+
 2014/11/05 - 0.8
 ----------------
 
 - Issue #22457: Honour load_tests in the start_dir of discovery.
 
+- Issue #22894: TestCase.subTest() would cause the test suite to be stopped
+  when in failfast mode, even in the absence of failures.
+
 2014/10/31 - 0.7.1
 ------------------
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/unittest2-0.8.0/setup.cfg 
new/unittest2-1.0.1/setup.cfg
--- old/unittest2-0.8.0/setup.cfg       2014-11-04 16:26:26.000000000 +0100
+++ new/unittest2-1.0.1/setup.cfg       2015-03-12 03:56:02.000000000 +0100
@@ -1,6 +1,9 @@
 [sdist]
 force-manifest = 1
 
+[bdist_wheel]
+universal = 1
+
 [egg_info]
 tag_build = 
 tag_date = 0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/unittest2-0.8.0/setup.py new/unittest2-1.0.1/setup.py
--- old/unittest2-0.8.0/setup.py        2014-11-04 15:51:22.000000000 +0100
+++ new/unittest2-1.0.1/setup.py        2015-03-12 03:53:46.000000000 +0100
@@ -57,7 +57,7 @@
 # Both install and setup requires - because we read VERSION from within the
 # package, and the package also exports all the APIs.
 # six for compat helpers
-REQUIRES = ['argparse', 'six'],
+REQUIRES = ['argparse', 'six>=1.4', 'traceback2'],
 
 params = dict(
     name=NAME,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/unittest2-0.8.0/unittest2/__init__.py 
new/unittest2-1.0.1/unittest2/__init__.py
--- old/unittest2-0.8.0/unittest2/__init__.py   2014-11-04 16:25:51.000000000 
+0100
+++ new/unittest2-1.0.1/unittest2/__init__.py   2015-03-12 03:55:19.000000000 
+0100
@@ -31,7 +31,7 @@
            'defaultTestLoader', 'SkipTest', 'skip', 'skipIf', 'skipUnless',
            'expectedFailure', 'TextTestResult', '__version__', 'collector']
 
-__version__ = '0.8.0'
+__version__ = '1.0.1'
 
 # Expose obsolete functions for backwards compatibility
 __all__.extend(['getTestCaseNames', 'makeSuite', 'findTestCases'])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/unittest2-0.8.0/unittest2/main.py 
new/unittest2-1.0.1/unittest2/main.py
--- old/unittest2-0.8.0/unittest2/main.py       2014-10-31 07:25:15.000000000 
+0100
+++ new/unittest2-1.0.1/unittest2/main.py       2015-03-06 05:59:33.000000000 
+0100
@@ -65,7 +65,8 @@
     def __init__(self, module='__main__', defaultTest=None,
                  argv=None, testRunner=None,
                  testLoader=loader.defaultTestLoader, exit=True,
-                 verbosity=1, failfast=None, catchbreak=None, buffer=None):
+                 verbosity=1, failfast=None, catchbreak=None, buffer=None,
+                 tb_locals=False):
         if isinstance(module, six.string_types):
             self.module = __import__(module)
             for part in module.split('.')[1:]:
@@ -80,6 +81,7 @@
         self.failfast = failfast
         self.catchbreak = catchbreak
         self.buffer = buffer
+        self.tb_locals = tb_locals
         self.defaultTest = defaultTest
         self.testRunner = testRunner
         self.testLoader = testLoader
@@ -153,7 +155,9 @@
         parser.add_argument('-q', '--quiet', dest='verbosity',
                             action='store_const', const=0,
                             help='Quiet output')
-
+        parser.add_argument('--locals', dest='tb_locals',
+                            action='store_true',
+                            help='Show local variables in tracebacks')
         if self.failfast is None:
             parser.add_argument('-f', '--failfast', dest='failfast',
                                 action='store_true',
@@ -225,9 +229,16 @@
             self.testRunner = runner.TextTestRunner
         if isinstance(self.testRunner, six.class_types):
             try:
-                testRunner = self.testRunner(verbosity=self.verbosity,
-                                             failfast=self.failfast,
-                                             buffer=self.buffer)
+                try:
+                    testRunner = self.testRunner(verbosity=self.verbosity,
+                                                 failfast=self.failfast,
+                                                 buffer=self.buffer,
+                                                 tb_locals=self.tb_locals)
+                except TypeError:
+                    # didn't accept the tb_locals argument
+                    testRunner = self.testRunner(verbosity=self.verbosity,
+                                                 failfast=self.failfast,
+                                                 buffer=self.buffer)
             except TypeError:
                 # didn't accept the verbosity, buffer or failfast arguments
                 testRunner = self.testRunner()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/unittest2-0.8.0/unittest2/result.py 
new/unittest2-1.0.1/unittest2/result.py
--- old/unittest2-0.8.0/unittest2/result.py     2014-10-29 02:38:35.000000000 
+0100
+++ new/unittest2-1.0.1/unittest2/result.py     2015-03-06 06:17:01.000000000 
+0100
@@ -1,10 +1,10 @@
 """Test result object"""
 
 import sys
-import traceback
 import unittest
 
 from six.moves import StringIO
+import traceback2 as traceback
 
 from unittest2 import util
 from unittest2.compatibility import wraps
@@ -47,6 +47,7 @@
         self.unexpectedSuccesses = []
         self.shouldStop = False
         self.buffer = False
+        self.tb_locals = False
         self._stdout_buffer = None
         self._stderr_buffer = None
         self._original_stdout = sys.stdout
@@ -115,7 +116,6 @@
         self.failures.append((test, self._exc_info_to_string(err, test)))
         self._mirrorOutput = True
 
-    @failfast
     def addSubTest(self, test, subtest, err):
         """Called at the end of a subtest.
         'err' is None if the subtest ended successfully, otherwise it's a
@@ -124,6 +124,8 @@
         # By default, we don't do anything with successful subtests, but
         # more sophisticated test results might want to record them.
         if err is not None:
+            if getattr(self, 'failfast', False):
+                self.stop()
             if issubclass(err[0], test.failureException):
                 errors = self.failures
             else:
@@ -171,9 +173,11 @@
         if exctype is test.failureException:
             # Skip assert*() traceback levels
             length = self._count_relevant_tb_levels(tb)
-            msgLines = traceback.format_exception(exctype, value, tb, length)
         else:
-            msgLines = traceback.format_exception(exctype, value, tb)
+            length = None
+        tb_e = traceback.TracebackException(
+            exctype, value, tb, limit=length, capture_locals=self.tb_locals)
+        msgLines = list(tb_e.format())
 
         if self.buffer:
             output = sys.stdout.getvalue()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/unittest2-0.8.0/unittest2/runner.py 
new/unittest2-1.0.1/unittest2/runner.py
--- old/unittest2-0.8.0/unittest2/runner.py     2014-10-28 08:43:01.000000000 
+0100
+++ new/unittest2-1.0.1/unittest2/runner.py     2015-03-06 06:22:55.000000000 
+0100
@@ -4,6 +4,8 @@
 import time
 import unittest
 
+from six import u
+
 from unittest2 import result
 
 try:
@@ -28,7 +30,7 @@
     def writeln(self, arg=None):
         if arg:
             self.write(arg)
-        self.write('\n') # text-mode streams translate to \r\n if needed
+        self.write(u('\n')) # text-mode streams translate to \r\n if needed
 
 
 class TextTestResult(result.TestResult):
@@ -36,8 +38,8 @@
 
     Used by TextTestRunner.
     """
-    separator1 = '=' * 70
-    separator2 = '-' * 70
+    separator1 = u('=' * 70)
+    separator2 = u('-' * 70)
 
     def __init__(self, stream, descriptions, verbosity):
         super(TextTestResult, self).__init__(stream, descriptions, verbosity)
@@ -135,12 +137,19 @@
     resultclass = TextTestResult
 
     def __init__(self, stream=sys.stderr, descriptions=True, verbosity=1,
-                    failfast=False, buffer=False, resultclass=None):
+                 failfast=False, buffer=False, resultclass=None,
+                 tb_locals=False):
+        """Construct a TextTestRunner.
+
+        Subclasses should accept **kwargs to ensure compatibility as the
+        interface changes.
+        """
         self.stream = _WritelnDecorator(stream)
         self.descriptions = descriptions
         self.verbosity = verbosity
         self.failfast = failfast
         self.buffer = buffer
+        self.tb_locals = tb_locals
         if resultclass is not None:
             self.resultclass = resultclass
 
@@ -152,6 +161,7 @@
         result = self._makeResult()
         result.failfast = self.failfast
         result.buffer = self.buffer
+        result.tb_locals = self.tb_locals
         registerResult(result)
 
         startTime = time.time()
@@ -171,7 +181,7 @@
         if hasattr(result, 'separator2'):
             self.stream.writeln(result.separator2)
         run = result.testsRun
-        self.stream.writeln("Ran %d test%s in %.3fs" %
+        self.stream.writeln(u("Ran %d test%s in %.3fs") %
                             (run, run != 1 and "s" or "", timeTaken))
         self.stream.writeln()
 
@@ -186,22 +196,22 @@
             expectedFails, unexpectedSuccesses, skipped = results
         infos = []
         if not result.wasSuccessful():
-            self.stream.write("FAILED")
+            self.stream.write(u("FAILED"))
             failed, errored = map(len, (result.failures, result.errors))
             if failed:
-                infos.append("failures=%d" % failed)
+                infos.append(u("failures=%d") % failed)
             if errored:
-                infos.append("errors=%d" % errored)
+                infos.append(u("errors=%d") % errored)
         else:
-            self.stream.write("OK")
+            self.stream.write(u("OK"))
         if skipped:
-            infos.append("skipped=%d" % skipped)
+            infos.append(u("skipped=%d") % skipped)
         if expectedFails:
-            infos.append("expected failures=%d" % expectedFails)
+            infos.append(u("expected failures=%d") % expectedFails)
         if unexpectedSuccesses:
-            infos.append("unexpected successes=%d" % unexpectedSuccesses)
+            infos.append(u("unexpected successes=%d") % unexpectedSuccesses)
         if infos:
-            self.stream.writeln(" (%s)" % (", ".join(infos),))
+            self.stream.writeln(u(" (%s)") % (u(", ").join(infos),))
         else:
-            self.stream.write("\n")
+            self.stream.write(u("\n"))
         return result
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/unittest2-0.8.0/unittest2/test/test_break.py 
new/unittest2-1.0.1/unittest2/test/test_break.py
--- old/unittest2-0.8.0/unittest2/test/test_break.py    2014-10-28 
23:54:40.000000000 +0100
+++ new/unittest2-1.0.1/unittest2/test/test_break.py    2015-03-06 
06:01:36.000000000 +0100
@@ -213,6 +213,7 @@
                 self.verbosity = verbosity
                 self.failfast = failfast
                 self.catchbreak = catchbreak
+                self.tb_locals = False
                 self.testRunner = FakeRunner
                 self.test = test
                 self.result = None
@@ -221,8 +222,9 @@
         p.runTests()
 
         self.assertEqual(FakeRunner.initArgs, [((), {'verbosity': verbosity,
-                                                'failfast': failfast,
-                                                'buffer': None})])
+                                                     'failfast': failfast,
+                                                     'tb_locals': False,
+                                                     'buffer': None})])
         self.assertEqual(FakeRunner.runArgs, [test])
         self.assertEqual(p.result, result)
 
@@ -234,8 +236,9 @@
         p.runTests()
 
         self.assertEqual(FakeRunner.initArgs, [((), {'verbosity': verbosity,
-                                                'failfast': failfast,
-                                                'buffer': None})])
+                                                     'failfast': failfast,
+                                                     'tb_locals': False,
+                                                     'buffer': None})])
         self.assertEqual(FakeRunner.runArgs, [test])
         self.assertEqual(p.result, result)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/unittest2-0.8.0/unittest2/test/test_case.py 
new/unittest2-1.0.1/unittest2/test/test_case.py
--- old/unittest2-0.8.0/unittest2/test/test_case.py     2014-10-30 
10:54:05.000000000 +0100
+++ new/unittest2-1.0.1/unittest2/test/test_case.py     2015-03-06 
05:45:21.000000000 +0100
@@ -391,6 +391,34 @@
         Foo(events).run(result)
         self.assertEqual(events, expected)
 
+    def test_subtests_failfast(self):
+        # Ensure proper test flow with subtests and failfast (issue #22894)
+        events = []
+
+        class Foo(unittest.TestCase):
+            def test_a(self):
+                with self.subTest():
+                    events.append('a1')
+                events.append('a2')
+
+            def test_b(self):
+                with self.subTest():
+                    events.append('b1')
+                with self.subTest():
+                    self.fail('failure')
+                events.append('b2')
+
+            def test_c(self):
+                events.append('c')
+
+        result = unittest.TestResult()
+        result.failfast = True
+        suite = unittest.makeSuite(Foo)
+        suite.run(result)
+
+        expected = ['a1', 'a2', 'b1']
+        self.assertEqual(events, expected)
+
     # "This class attribute gives the exception raised by the test() method.
     # If a test framework needs to use a specialized exception, possibly to
     # carry additional information, it must subclass this exception in
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/unittest2-0.8.0/unittest2/test/test_program.py 
new/unittest2-1.0.1/unittest2/test/test_program.py
--- old/unittest2-0.8.0/unittest2/test/test_program.py  2014-10-29 
11:50:49.000000000 +0100
+++ new/unittest2-1.0.1/unittest2/test/test_program.py  2015-03-06 
06:13:56.000000000 +0100
@@ -118,6 +118,7 @@
     result = None
     verbosity = 1
     defaultTest = None
+    tb_locals = False
     testRunner = None
     testLoader = unittest2.defaultTestLoader
     progName = 'test'
@@ -130,18 +131,19 @@
 class FakeRunner(object):
     initArgs = None
     test = None
-    raiseError = False
+    raiseError = 0
 
     def __init__(self, **kwargs):
         FakeRunner.initArgs = kwargs
         if FakeRunner.raiseError:
-            FakeRunner.raiseError = False
+            FakeRunner.raiseError -= 1
             raise TypeError
 
     def run(self, test):
         FakeRunner.test = test
         return RESULT
 
+
 class TestCommandLineArgs(unittest2.TestCase):
 
     def setUp(self):
@@ -149,7 +151,7 @@
         self.program.createTests = lambda: None
         FakeRunner.initArgs = None
         FakeRunner.test = None
-        FakeRunner.raiseError = False
+        FakeRunner.raiseError = 0
 
     def testVerbosity(self):
         program = self.program
@@ -225,6 +227,7 @@
 
         self.assertEqual(FakeRunner.initArgs, {'verbosity': 'verbosity',
                                                 'failfast': 'failfast',
+                                                'tb_locals': False,
                                                 'buffer': 'buffer'})
         self.assertEqual(FakeRunner.test, 'test')
         self.assertIs(program.result, RESULT)
@@ -243,10 +246,24 @@
         self.assertEqual(FakeRunner.test, 'test')
         self.assertIs(program.result, RESULT)
 
+    def test_locals(self):
+        program = self.program
+
+        program.testRunner = FakeRunner
+        program.parseArgs([None, '--locals'])
+        self.assertEqual(True, program.tb_locals)
+        program.runTests()
+        self.assertEqual(FakeRunner.initArgs, {'buffer': False,
+                                               'failfast': False,
+                                               'tb_locals': True,
+                                               'verbosity': 1})
+
     def testRunTestsOldRunnerClass(self):
         program = self.program
 
-        FakeRunner.raiseError = True
+        # Two TypeErrors are needed to fall all the way back to old-style
+        # runners - one to fail tb_locals, one to fail buffer etc.
+        FakeRunner.raiseError = 2
         program.testRunner = FakeRunner
         program.verbosity = 'verbosity'
         program.failfast = 'failfast'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/unittest2-0.8.0/unittest2/test/test_result.py 
new/unittest2-1.0.1/unittest2/test/test_result.py
--- old/unittest2-0.8.0/unittest2/test/test_result.py   2014-10-29 
11:05:10.000000000 +0100
+++ new/unittest2-1.0.1/unittest2/test/test_result.py   2015-03-06 
06:20:12.000000000 +0100
@@ -1,13 +1,28 @@
 import sys
 import textwrap
-import traceback
+import traceback2 as traceback
 
+import six
 from six.moves import StringIO
 
 import unittest2
 import unittest2 as unittest
 
 
+class MockTraceback(object):
+    class TracebackException:
+        def __init__(self, *args, **kwargs):
+            self.capture_locals = kwargs.get('capture_locals', False)
+        def format(self):
+            result = ['A traceback']
+            if self.capture_locals:
+                result.append('locals')
+            return result
+
+def restore_traceback():
+    unittest.result.traceback = traceback
+
+
 class Test_TestResult(unittest2.TestCase):
     # Note: there are not separate tests for TestResult.wasSuccessful(),
     # TestResult.errors, TestResult.failures, TestResult.testsRun or
@@ -177,7 +192,7 @@
 
         test_case, formatted_exc = result.failures[0]
         self.assertIs(test_case, test)
-        self.assertIsInstance(formatted_exc, str)
+        self.assertIsInstance(formatted_exc, six.string_types)
 
     # "addError(test, err)"
     # ...
@@ -225,7 +240,26 @@
 
         test_case, formatted_exc = result.errors[0]
         self.assertIs(test_case, test)
-        self.assertIsInstance(formatted_exc, str)
+        self.assertIsInstance(formatted_exc, six.string_types)
+
+    def test_addError_locals(self):
+        class Foo(unittest.TestCase):
+            def test_1(self):
+                1/0
+
+        test = Foo('test_1')
+        result = unittest.TestResult()
+        result.tb_locals = True
+
+        unittest.result.traceback = MockTraceback
+        self.addCleanup(restore_traceback)
+        result.startTestRun()
+        test.run(result)
+        result.stopTestRun()
+
+        self.assertEqual(len(result.errors), 1)
+        test_case, formatted_exc = result.errors[0]
+        self.assertEqual('A tracebacklocals', formatted_exc)
 
     def test_addSubTest(self):
         log = []
@@ -391,16 +425,6 @@
         self.assertTrue(self.testRan)
 
 
-class MockTraceback(object):
-    @staticmethod
-    def format_exception(*_):
-        return ['A traceback']
-
-
-def restore_traceback():
-    unittest2.result.traceback = traceback
-
-                
 class TestOutputBuffering(unittest2.TestCase):
 
     def setUp(self):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/unittest2-0.8.0/unittest2/test/test_runner.py 
new/unittest2-1.0.1/unittest2/test/test_runner.py
--- old/unittest2-0.8.0/unittest2/test/test_runner.py   2014-10-28 
23:46:13.000000000 +0100
+++ new/unittest2-1.0.1/unittest2/test/test_runner.py   2015-03-06 
06:05:12.000000000 +0100
@@ -160,7 +160,7 @@
         self.assertEqual(runner.verbosity, 1)
         self.assertTrue(runner.descriptions)
         self.assertEqual(runner.resultclass, unittest2.TextTestResult)
-
+        self.assertFalse(runner.tb_locals)
 
     def test_multiple_inheritance(self):
         class AResult(unittest.TestResult):
@@ -181,7 +181,7 @@
                 pass
         result = unittest2.TestResult()
         runner = unittest2.TextTestRunner(stream=StringIO(), failfast=True,
-                                           buffer=True)
+                                          buffer=True)
         # Use our result object
         runner._makeResult = lambda: result
         runner.run(Test('testFoo'))
@@ -189,6 +189,11 @@
         self.assertTrue(result.failfast)
         self.assertTrue(result.buffer)
 
+    def test_locals(self):
+        runner = unittest.TextTestRunner(stream=io.StringIO(), tb_locals=True)
+        result = runner.run(unittest.TestSuite())
+        self.assertEqual(True, result.tb_locals)
+
     def testRunnerRegistersResult(self):
         class Test(unittest2.TestCase):
             def testFoo(self):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/unittest2-0.8.0/unittest2/util.py 
new/unittest2-1.0.1/unittest2/util.py
--- old/unittest2-0.8.0/unittest2/util.py       2014-10-29 04:25:24.000000000 
+0100
+++ new/unittest2-1.0.1/unittest2/util.py       2014-11-05 10:17:14.000000000 
+0100
@@ -60,45 +60,6 @@
 def strclass(cls):
     return "%s.%s" % (cls.__module__, getattr(cls, '__qualname__', 
cls.__name__))
 
-def sorted_list_difference(expected, actual):
-    """Finds elements in only one or the other of two, sorted input lists.
-
-    Returns a two-element tuple of lists.    The first list contains those
-    elements in the "expected" list but not in the "actual" list, and the
-    second contains those elements in the "actual" list but not in the
-    "expected" list.    Duplicate elements in either input list are ignored.
-    """
-    i = j = 0
-    missing = []
-    unexpected = []
-    while True:
-        try:
-            e = expected[i]
-            a = actual[j]
-            if e < a:
-                missing.append(e)
-                i += 1
-                while expected[i] == e:
-                    i += 1
-            elif e > a:
-                unexpected.append(a)
-                j += 1
-                while actual[j] == a:
-                    j += 1
-            else:
-                i += 1
-                try:
-                    while expected[i] == e:
-                        i += 1
-                finally:
-                    j += 1
-                    while actual[j] == a:
-                        j += 1
-        except IndexError:
-            missing.extend(expected[i:])
-            unexpected.extend(actual[j:])
-            break
-    return missing, unexpected
 
 def unorderable_list_difference(expected, actual, ignore_duplicate=False):
     """Same behavior as sorted_list_difference but
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/unittest2-0.8.0/unittest2.egg-info/PKG-INFO 
new/unittest2-1.0.1/unittest2.egg-info/PKG-INFO
--- old/unittest2-0.8.0/unittest2.egg-info/PKG-INFO     2014-11-04 
16:26:25.000000000 +0100
+++ new/unittest2-1.0.1/unittest2.egg-info/PKG-INFO     2015-03-12 
03:56:02.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: unittest2
-Version: 0.8.0
+Version: 1.0.1
 Summary: The new features in unittest backported to Python 2.4+.
 Home-page: http://pypi.python.org/pypi/unittest2
 Author: Michael Foord
@@ -30,8 +30,9 @@
         
         * `Download unittest2 0.5.1 for Python 2.3 
<http://voidspace.org.uk/downloads/unittest2-0.5.1-python2.3.zip>`_
         
-        There is also a version of unittest2 for Python 3. This has the 
project name
-        "unittest2py3k" but uses the same package name ("unittest2"):
+        There was a separate version of unittest2 for Python 3. This is no 
longer
+        needed, but still exists on PyPI. This had the project name 
"unittest2py3k" but
+        uses the same package name ("unittest2"):
         
         * `unittest2 for Python 3 <http://pypi.python.org/pypi/unittest2py3k>`_
         
@@ -43,6 +44,11 @@
         will work with the standard unittest test loaders, runners result 
objects
         however.
         
+        In general for documentation on unittest2 see the current latest 
documented of
+        CPython:
+        
+        * `CPython unittest documentation 
<https://docs.python.org/dev/library/unittest.html>`_
+        
         New features include:
         
         * ``addCleanups`` - better resource management
@@ -169,11 +175,24 @@
         CHANGELOG
         =========
         
+        2015-03-12 - 1.0.1
+        ------------------
+        
+        - Unittest2 issue #94: Need at least 1.4 of six.
+        
+        2015-03-06 - 1.0.0
+        ------------------
+        
+        - Issue #22936: Permit showing local variables in tracebacks.
+        
         2014/11/05 - 0.8
         ----------------
         
         - Issue #22457: Honour load_tests in the start_dir of discovery.
         
+        - Issue #22894: TestCase.subTest() would cause the test suite to be 
stopped
+          when in failfast mode, even in the absence of failures.
+        
         2014/10/31 - 0.7.1
         ------------------
         
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/unittest2-0.8.0/unittest2.egg-info/requires.txt 
new/unittest2-1.0.1/unittest2.egg-info/requires.txt
--- old/unittest2-0.8.0/unittest2.egg-info/requires.txt 2014-11-04 
16:26:25.000000000 +0100
+++ new/unittest2-1.0.1/unittest2.egg-info/requires.txt 2015-03-12 
03:56:02.000000000 +0100
@@ -1,2 +1,3 @@
 argparse
-six
+six>=1.4
+traceback2

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to