Hello community,

here is the log from the commit of package python-nose for openSUSE:Factory 
checked in at 2018-07-21 10:08:36
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-nose (Old)
 and      /work/SRC/openSUSE:Factory/.python-nose.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-nose"

Sat Jul 21 10:08:36 2018 rev:40 rq:623471 version:1.3.7

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-nose/python-nose.changes  2018-02-05 
10:48:13.465749667 +0100
+++ /work/SRC/openSUSE:Factory/.python-nose.new/python-nose.changes     
2018-07-21 10:08:40.911191898 +0200
@@ -1,0 +2,11 @@
+Tue Jul 17 08:58:34 UTC 2018 - [email protected]
+
+- Add patches from other distros, fixes py3.7 builds as well:
+  * python-nose-coverage4.patch
+  * python-nose-py35.patch
+  * python-nose-py36.patch
+  * python-nose-readunicode.patch
+  * python-nose-unicode.patch
+  * python-nose-unstable-tests.patch
+
+-------------------------------------------------------------------

New:
----
  python-nose-coverage4.patch
  python-nose-py35.patch
  python-nose-py36.patch
  python-nose-readunicode.patch
  python-nose-unicode.patch
  python-nose-unstable-tests.patch

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

Other differences:
------------------
++++++ python-nose.spec ++++++
--- /var/tmp/diff_new_pack.bJx1XJ/_old  2018-07-21 10:08:41.275191814 +0200
+++ /var/tmp/diff_new_pack.bJx1XJ/_new  2018-07-21 10:08:41.275191814 +0200
@@ -20,13 +20,17 @@
 Name:           python-nose
 Version:        1.3.7
 Release:        0
-Url:            http://readthedocs.org/docs/nose/
 Summary:        Nose extends unittest to make testing easier
-License:        LGPL-2.1+
+License:        LGPL-2.1-or-later
 Group:          Development/Languages/Python
-Source:         
http://pypi.python.org/packages/source/n/nose/nose-%{version}.tar.gz
-BuildRoot:      %{_tmppath}/%{name}-%{version}-build
-BuildRequires:  %{python_module devel}
+URL:            http://readthedocs.org/docs/nose/
+Source:         
https://files.pythonhosted.org/packages/source/n/nose/nose-%{version}.tar.gz
+Patch0:         python-nose-coverage4.patch
+Patch1:         python-nose-py35.patch
+Patch2:         python-nose-py36.patch
+Patch3:         python-nose-readunicode.patch
+Patch4:         python-nose-unicode.patch
+Patch5:         python-nose-unstable-tests.patch
 BuildRequires:  %{python_module setuptools}
 BuildRequires:  %{python_module xml}
 BuildRequires:  fdupes
@@ -37,7 +41,6 @@
 Requires(post): update-alternatives
 Requires(postun): update-alternatives
 BuildArch:      noarch
-
 %python_subpackages
 
 %description
@@ -57,6 +60,8 @@
 
 %prep
 %setup -q -n nose-%{version}
+%autopatch -p1
+
 sed -i "s|man/man1|share/man/man1|" setup.py # Fix man-page install path
 # this test doesn't work
 rm functional_tests/test_coverage_plugin*
@@ -76,7 +81,6 @@
 # Timing is bad on some architectures
 export NOSE_EXCLUDE=test_timed
 # tests mysteriously fail in python3
-%{_python_use_flavor python2}
 python2 setup.py test
 %endif
 
@@ -86,9 +90,9 @@
 %postun
 %python_uninstall_alternative nosetests
 
-%files %python_files
-%defattr(-,root,root,-)
-%doc NEWS README.txt lgpl.txt
+%files %{python_files}
+%license lgpl.txt
+%doc NEWS README.txt
 %python_alternative %{_bindir}/nosetests
 %python_alternative %{_mandir}/man1/nosetests.1%{ext_man}
 %{python_sitelib}/nose-%{version}-py%{python_version}.egg-info/

++++++ python-nose-coverage4.patch ++++++
diff -up nose-1.3.7/nose/plugins/cover.py.coverage4 
nose-1.3.7/nose/plugins/cover.py
--- nose-1.3.7/nose/plugins/cover.py.coverage4  2015-04-04 03:28:20.000000000 
-0600
+++ nose-1.3.7/nose/plugins/cover.py    2016-11-09 16:16:32.832927855 -0700
@@ -187,7 +187,7 @@ class Coverage(Plugin):
                     for name, module in sys.modules.items()
                     if self.wantModuleCoverage(name, module)]
         log.debug("Coverage report will cover modules: %s", modules)
-        self.coverInstance.report(modules, file=stream)
+        self.coverInstance.report(modules, file=stream, show_missing=True)
 
         import coverage
         if self.coverHtmlDir:
@@ -207,7 +207,7 @@ class Coverage(Plugin):
         # make sure we have minimum required coverage
         if self.coverMinPercentage:
             f = StringIO.StringIO()
-            self.coverInstance.report(modules, file=f)
+            self.coverInstance.report(modules, file=f, show_missing=True)
 
             multiPackageRe = (r'-------\s\w+\s+\d+\s+\d+(?:\s+\d+\s+\d+)?'
                               r'\s+(\d+)%\s+\d*\s{0,1}$')
++++++ python-nose-py35.patch ++++++
diff -up nose-1.3.7/functional_tests/test_load_tests_from_test_case.py.py35 
nose-1.3.7/functional_tests/test_load_tests_from_test_case.py
--- nose-1.3.7/functional_tests/test_load_tests_from_test_case.py.py35  
2012-09-29 02:18:54.000000000 -0600
+++ nose-1.3.7/functional_tests/test_load_tests_from_test_case.py       
2016-11-15 13:42:27.946707472 -0700
@@ -29,6 +29,7 @@ class NoFixturePlug(Plugin):
                 pass
             def tearDown(self):
                 pass
+        Derived.__qualname__ = Derived.__name__
         # must use nose loader here because the default loader in 2.3
         # won't load tests from base classes
         l = loader.TestLoader()
diff -up nose-1.3.7/nose/util.py.py35 nose-1.3.7/nose/util.py
--- nose-1.3.7/nose/util.py.py35        2015-04-04 02:52:52.000000000 -0600
+++ nose-1.3.7/nose/util.py     2016-11-15 13:42:27.946707472 -0700
@@ -643,6 +643,7 @@ def transplant_class(cls, module):
         pass
     C.__module__ = module
     C.__name__ = cls.__name__
+    C.__qualname__ = cls.__name__
     return C
 
 
diff -up nose-1.3.7/unit_tests/test_xunit.py.py35 
nose-1.3.7/unit_tests/test_xunit.py
--- nose-1.3.7/unit_tests/test_xunit.py.py35    2015-04-04 02:52:52.000000000 
-0600
+++ nose-1.3.7/unit_tests/test_xunit.py 2016-11-15 13:42:27.946707472 -0700
@@ -16,6 +16,7 @@ def mktest():
     class TC(unittest.TestCase):
         def runTest(self):
             pass
+    TC.__qualname__ = TC.__name__
     test = TC()
     return test
 
++++++ python-nose-py36.patch ++++++
>From acf7c4e073030a69712172b133076101e2b7d81f Mon Sep 17 00:00:00 2001
From: Tomas Orsava <[email protected]>
Date: Mon, 12 Dec 2016 12:09:47 +0100
Subject: [PATCH] Patch for compatibility with Python 3.6

Python 3.6 returns a ModuleNotFoundError instead of the previous ImportError.
---
 functional_tests/test_loader.py           |  2 +-
 functional_tests/test_withid_failures.rst | 12 ++++++------
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/functional_tests/test_loader.py b/functional_tests/test_loader.py
index 81aaa7b..3f82122 100644
--- a/functional_tests/test_loader.py
+++ b/functional_tests/test_loader.py
@@ -369,7 +369,7 @@ class TestNoseTestLoader(unittest.TestCase):
         assert res.errors, "Expected errors but got none"
         assert not res.failures, res.failures
         err = res.errors[0][0].test.exc_class
-        assert err is ImportError, \
+        assert issubclass(err, ImportError), \
             "Expected import error, got %s" % err
 
     def test_load_nonsense_name(self):
diff --git a/functional_tests/test_withid_failures.rst 
b/functional_tests/test_withid_failures.rst
index cf09d4f..cb20886 100644
--- a/functional_tests/test_withid_failures.rst
+++ b/functional_tests/test_withid_failures.rst
@@ -7,16 +7,16 @@
     >>> support = os.path.join(os.path.dirname(__file__), 'support', 
'id_fails')
     >>> argv = [__file__, '-v', '--with-id', '--id-file', idfile, support]
     >>> run(argv=argv, plugins=[TestId()]) # doctest: +ELLIPSIS
-    #1 Failure: ImportError (No module ...apackagethatdoesntexist...) ... ERROR
+    #1 Failure: ... (No module ...apackagethatdoesntexist...) ... ERROR
     #2 test_b.test ... ok
     #3 test_b.test_fail ... FAIL
     <BLANKLINE>
     ======================================================================
-    ERROR: Failure: ImportError (No module ...apackagethatdoesntexist...)
+    ERROR: Failure: ... (No module ...apackagethatdoesntexist...)
     ----------------------------------------------------------------------
     Traceback (most recent call last):
     ...
-    ImportError: No module ...apackagethatdoesntexist...
+    ...: No module ...apackagethatdoesntexist...
     <BLANKLINE>
     ======================================================================
     FAIL: test_b.test_fail
@@ -35,14 +35,14 @@ Addressing failures works (sometimes).
     >>> argv.append('1')
     >>> _junk = sys.modules.pop('test_a', None) # 2.3 requires
     >>> run(argv=argv, plugins=[TestId()]) #doctest: +ELLIPSIS
-    #1 Failure: ImportError (No module ...apackagethatdoesntexist...) ... ERROR
+    #1 Failure: ... (No module ...apackagethatdoesntexist...) ... ERROR
     <BLANKLINE>
     ======================================================================
-    ERROR: Failure: ImportError (No module ...apackagethatdoesntexist...)
+    ERROR: Failure: ... (No module ...apackagethatdoesntexist...)
     ----------------------------------------------------------------------
     Traceback (most recent call last):
     ...
-    ImportError: No module ...apackagethatdoesntexist...
+    ...: No module ...apackagethatdoesntexist...
     <BLANKLINE>
     ----------------------------------------------------------------------
     Ran 1 test in ...s
-- 
2.11.0

++++++ python-nose-readunicode.patch ++++++
diff -up nose-1.3.7/nose/plugins/doctests.py.readunicode 
nose-1.3.7/nose/plugins/doctests.py
--- nose-1.3.7/nose/plugins/doctests.py.readunicode     2015-04-04 
02:52:52.000000000 -0600
+++ nose-1.3.7/nose/plugins/doctests.py 2016-11-15 14:24:54.298239018 -0700
@@ -49,6 +49,7 @@ test.
 """
 from __future__ import generators
 
+import codecs
 import logging
 import os
 import sys
@@ -259,7 +260,7 @@ class Doctest(Plugin):
         """
         if self.extension and anyp(filename.endswith, self.extension):
             name = os.path.basename(filename)
-            dh = open(filename)
+            dh = codecs.open(filename, encoding='utf-8')
             try:
                 doc = dh.read()
             finally:
++++++ python-nose-unicode.patch ++++++
diff -up nose-1.3.7/AUTHORS.unicode nose-1.3.7/AUTHORS
diff -up nose-1.3.7/CHANGELOG.unicode nose-1.3.7/CHANGELOG
diff -up nose-1.3.7/nose/plugins/capture.py.unicode 
nose-1.3.7/nose/plugins/capture.py
--- nose-1.3.7/nose/plugins/capture.py.unicode  2015-04-04 02:52:52.000000000 
-0600
+++ nose-1.3.7/nose/plugins/capture.py  2016-11-15 13:58:18.713025335 -0700
@@ -12,6 +12,7 @@ the options ``-s`` or ``--nocapture``.
 import logging
 import os
 import sys
+import traceback
 from nose.plugins.base import Plugin
 from nose.pyversion import exc_to_unicode, force_unicode
 from nose.util import ln
@@ -71,26 +72,56 @@ class Capture(Plugin):
     def formatError(self, test, err):
         """Add captured output to error report.
         """
-        test.capturedOutput = output = self.buffer
+        test.capturedOutput = output = ''
+        output_exc_info = None
+        try:
+            test.capturedOutput = output = self.buffer
+        except UnicodeError:
+            # python2's StringIO.StringIO [1] class has this warning:
+            #
+            #     The StringIO object can accept either Unicode or 8-bit 
strings,
+            #     but mixing the two may take some care. If both are used, 
8-bit
+            #     strings that cannot be interpreted as 7-bit ASCII (that use 
the
+            #     8th bit) will cause a UnicodeError to be raised when 
getvalue()
+            #     is called.
+            #
+            # This exception handler is a protection against issue #816 [2].
+            # Capturing the exception info allows us to display it back to the
+            # user.
+            #
+            # [1] 
<https://github.com/python/cpython/blob/2.7/Lib/StringIO.py#L258>
+            # [2] <https://github.com/nose-devs/nose/issues/816>
+            output_exc_info = sys.exc_info()
         self._buf = None
-        if not output:
+        if (not output) and (not output_exc_info):
             # Don't return None as that will prevent other
             # formatters from formatting and remove earlier formatters
             # formats, instead return the err we got
             return err
         ec, ev, tb = err
-        return (ec, self.addCaptureToErr(ev, output), tb)
+        return (ec, self.addCaptureToErr(ev, output, 
output_exc_info=output_exc_info), tb)
 
     def formatFailure(self, test, err):
         """Add captured output to failure report.
         """
         return self.formatError(test, err)
 
-    def addCaptureToErr(self, ev, output):
+    def addCaptureToErr(self, ev, output, output_exc_info=None):
+        # If given, output_exc_info should be a 3-tuple from sys.exc_info(),
+        # from an exception raised while trying to get the captured output.
         ev = exc_to_unicode(ev)
         output = force_unicode(output)
-        return u'\n'.join([ev, ln(u'>> begin captured stdout <<'),
-                           output, ln(u'>> end captured stdout <<')])
+        error_text = [ev, ln(u'>> begin captured stdout <<'),
+                      output, ln(u'>> end captured stdout <<')]
+        if output_exc_info:
+            error_text.extend([u'OUTPUT ERROR: Could not get captured output.',
+                               # 
<https://github.com/python/cpython/blob/2.7/Lib/StringIO.py#L258>
+                               # <https://github.com/nose-devs/nose/issues/816>
+                               u"The test might've printed both 'unicode' 
strings and non-ASCII 8-bit 'str' strings.",
+                               ln(u'>> begin captured stdout exception 
traceback <<'),
+                               
u''.join(traceback.format_exception(*output_exc_info)),
+                               ln(u'>> end captured stdout exception traceback 
<<')])
+        return u'\n'.join(error_text)
 
     def start(self):
         self.stdout.append(sys.stdout)
diff -up nose-1.3.7/unit_tests/test_capture_plugin.py.unicode 
nose-1.3.7/unit_tests/test_capture_plugin.py
--- nose-1.3.7/unit_tests/test_capture_plugin.py.unicode        2012-09-29 
02:18:54.000000000 -0600
+++ nose-1.3.7/unit_tests/test_capture_plugin.py        2016-11-15 
13:58:18.714025330 -0700
@@ -4,6 +4,12 @@ import unittest
 from optparse import OptionParser
 from nose.config import Config
 from nose.plugins.capture import Capture
+from nose.pyversion import force_unicode
+
+if sys.version_info[0] == 2:
+    py2 = True
+else:
+    py2 = False
 
 class TestCapturePlugin(unittest.TestCase):
 
@@ -62,6 +68,35 @@ class TestCapturePlugin(unittest.TestCas
         c.end()
         self.assertEqual(c.buffer, "test 日本\n")
 
+    def test_does_not_crash_with_mixed_unicode_and_nonascii_str(self):
+        class Dummy:
+            pass
+        d = Dummy()
+        c = Capture()
+        c.start()
+        printed_nonascii_str = force_unicode("test 日本").encode('utf-8')
+        printed_unicode = force_unicode("Hello")
+        print printed_nonascii_str
+        print printed_unicode
+        try:
+            raise Exception("boom")
+        except:
+            err = sys.exc_info()
+        formatted = c.formatError(d, err)
+        _, fev, _ = formatted
+
+        if py2:
+            for string in [force_unicode(printed_nonascii_str, 
encoding='utf-8'), printed_unicode]:
+                assert string not in fev, "Output unexpectedly found in error 
message"
+            assert d.capturedOutput == '', "capturedOutput unexpectedly 
non-empty"
+            assert "OUTPUT ERROR" in fev
+            assert "captured stdout exception traceback" in fev
+            assert "UnicodeDecodeError" in fev
+        else:
+            for string in [repr(printed_nonascii_str), printed_unicode]:
+                assert string in fev, "Output not found in error message"
+                assert string in d.capturedOutput, "Output not attached to 
test"
+
     def test_format_error(self):
         class Dummy:
             pass
++++++ python-nose-unstable-tests.patch ++++++
From: Dmitry Shachnev <[email protected]>
Date: Thu, 8 Oct 2015 10:02:00 -0700
Subject: Disable some unstable tests in multiprocessing module

Forwarded: not-needed
Last-Update: 2014-05-04
---
 functional_tests/test_multiprocessing/test_keyboardinterrupt.py | 2 ++
 functional_tests/test_multiprocessing/test_process_timeout.py   | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/functional_tests/test_multiprocessing/test_keyboardinterrupt.py 
b/functional_tests/test_multiprocessing/test_keyboardinterrupt.py
index 18c8af1..aead7e2 100644
--- a/functional_tests/test_multiprocessing/test_keyboardinterrupt.py
+++ b/functional_tests/test_multiprocessing/test_keyboardinterrupt.py
@@ -63,6 +63,7 @@ def get_log_content(logfile):
     return content
 
 def test_keyboardinterrupt():
+    raise nose.SkipTest('Disabled in Debian')
     process, logfile, _ = keyboardinterrupt('keyboardinterrupt.py')
     stdout, stderr = [s.decode('utf-8') for s in process.communicate(None)]
     log = get_log_content(logfile)
@@ -83,6 +84,7 @@ def test_keyboardinterrupt():
 
 
 def test_keyboardinterrupt_twice():
+    raise nose.SkipTest('Disabled in Debian')
     process, logfile, killfile = 
keyboardinterrupt('keyboardinterrupt_twice.py')
     waitForKillFile(killfile)
     os.killpg(process.pid, signal.SIGINT)
diff --git a/functional_tests/test_multiprocessing/test_process_timeout.py 
b/functional_tests/test_multiprocessing/test_process_timeout.py
index 6b858f8..73b4e3b 100644
--- a/functional_tests/test_multiprocessing/test_process_timeout.py
+++ b/functional_tests/test_multiprocessing/test_process_timeout.py
@@ -1,4 +1,5 @@
 import os
+import nose
 
 from test_multiprocessing import MPTestBase
 
@@ -7,6 +8,7 @@ class TestMPTimeout(MPTestBase):
     suitepath = os.path.join(os.path.dirname(__file__), 'support', 
'timeout.py')
 
     def runTest(self):
+        raise nose.SkipTest('Disabled in Debian')
         assert "TimedOutException: 'timeout.test_timeout'" in self.output
         assert "Ran 2 tests in" in self.output
         assert "FAILED (errors=1)" in self.output

Reply via email to