Hello community,

here is the log from the commit of package python-junitxml for 
openSUSE:Leap:15.2 checked in at 2020-03-06 12:39:03
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Leap:15.2/python-junitxml (Old)
 and      /work/SRC/openSUSE:Leap:15.2/.python-junitxml.new.26092 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-junitxml"

Fri Mar  6 12:39:03 2020 rev:11 rq:776710 version:0.7

Changes:
--------
--- /work/SRC/openSUSE:Leap:15.2/python-junitxml/python-junitxml.changes        
2020-01-15 15:49:32.687463828 +0100
+++ 
/work/SRC/openSUSE:Leap:15.2/.python-junitxml.new.26092/python-junitxml.changes 
    2020-03-06 12:40:57.358745484 +0100
@@ -1,0 +2,11 @@
+Wed Oct 31 11:45:53 UTC 2018 - Tomáš Chvátal <[email protected]>
+
+- Fix download url
+- Make tests pass junitxml-tests.patch
+
+-------------------------------------------------------------------
+Wed Oct 24 15:01:18 UTC 2018 - Dirk Mueller <[email protected]>
+
+- switch to singlespec
+
+-------------------------------------------------------------------

New:
----
  junitxml-tests.patch

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

Other differences:
------------------
++++++ python-junitxml.spec ++++++
--- /var/tmp/diff_new_pack.bZcqnn/_old  2020-03-06 12:40:57.730745710 +0100
+++ /var/tmp/diff_new_pack.bZcqnn/_new  2020-03-06 12:40:57.734745712 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-junitxml
 #
-# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2018 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
@@ -12,47 +12,56 @@
 # license that conforms to the Open Source Definition (Version 1.9)
 # published by the Open Source Initiative.
 
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
 #
 
 
+%{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-junitxml
 Version:        0.7
 Release:        0
-Url:            https://launchpad.net/pyjunitxml
 Summary:        A pyunit extension to output JUnit compatible XML
-License:        LGPL-3.0+
+License:        LGPL-3.0-or-later
 Group:          Development/Languages/Python
-Source:         
http://pypi.python.org/packages/source/j/junitxml/junitxml-%{version}.tar.gz
-BuildRoot:      %{_tmppath}/%{name}-%{version}-build
-BuildRequires:  python-devel
-BuildRequires:  python-nose
-%if 0%{?suse_version} && 0%{?suse_version} <= 1110
-%{!?python_sitelib: %global python_sitelib %(python -c "from 
distutils.sysconfig import get_python_lib; print get_python_lib()")}
-%else
+URL:            https://launchpad.net/pyjunitxml
+Source:         
https://files.pythonhosted.org/packages/source/j/junitxml/junitxml-%{version}.tar.gz
+Patch0:         junitxml-tests.patch
+BuildRequires:  %{python_module nose}
+BuildRequires:  %{python_module setuptools}
+BuildRequires:  fdupes
 BuildArch:      noarch
-%endif
+%python_subpackages
 
 %description
 A Python unittest TestResult that outputs JUnit compatible XML.
 
 %prep
 %setup -q -n junitxml-%{version}
+%patch0 -p1
 
 %build
-python setup.py build
+%python_build
 
 %install
-python setup.py install --prefix=%{_prefix} --root=%{buildroot}
+%python_install
+%python_expand %fdupes %{buildroot}%{$python_sitelib}
 
-#TODO: Fix, doesn't run:
-#%%check
-#nosetests
-
-%files
-%defattr(-,root,root,-)
-%doc COPYING README
-%{_bindir}/pyjunitxml
+%python_clone -a %{buildroot}%{_bindir}/pyjunitxml
+
+%post
+%python_install_alternative pyjunitxml
+
+%postun
+%python_uninstall_alternative pyjunitxml
+
+%check
+# tests are failing
+%python_expand nosetests-%{$python_version}
+
+%files %{python_files}
+%license COPYING
+%doc README
+%python_alternative %{_bindir}/pyjunitxml
 %{python_sitelib}/*
 
 %changelog

++++++ junitxml-tests.patch ++++++
Index: junitxml-0.7/junitxml/tests/test_junitxml.py
===================================================================
--- junitxml-0.7.orig/junitxml/tests/test_junitxml.py
+++ junitxml-0.7/junitxml/tests/test_junitxml.py
@@ -32,6 +32,14 @@ class TestJUnitXmlResult__init__(unittes
     def test_with_stream(self):
         result = junitxml.JUnitXmlResult(StringIO())
 
+class ConsistantIdTestCase(unittest.TestCase):
+    """TestCase who's id is consistant accross python 2 & 3.
+    
+    This is to fix https://bugs.launchpad.net/pyjunitxml/+bug/1491635
+    """
+    
+    def id(self):
+        return "%s.%s" % (self.__class__.__name__, self._testMethodName)    
 
 class TestJUnitXmlResult(unittest.TestCase):
 
@@ -47,16 +55,6 @@ class TestJUnitXmlResult(unittest.TestCa
             r'(?s)<error (.*?)>.*?</error>', r'<error \1>error</error>',
             re.sub(r'time="\d+\.\d+"', 'time="0.000"', output)))
 
-    def run_test_or_simulate(self, test, method_name, manual_method,
-        *manual_args):
-        if getattr(test, method_name, None):
-            test.run(self.result)
-        else:
-            # older python - manually execute
-            self.result.startTest(test)
-            manual_method(test, *manual_args)
-            self.result.stopTest(test)
-
     def test_run_duration_handles_datestamping_in_the_past(self):
         # When used via subunit2junitxml, startTestRun is called before
         # any tz info in the test stream has been seen.
@@ -109,64 +107,47 @@ class TestJUnitXmlResult(unittest.TestCa
         self.assertTrue('Passes" name="test_me(version_1.6)"' in output)
 
     def test_erroring_test(self):
-        class Errors(unittest.TestCase):
+        class Errors(ConsistantIdTestCase):
             def test_me(self):
                 1/0
         self.result.startTestRun()
         Errors("test_me").run(self.result)
         self.result.stopTestRun()
         self.assertEqual("""<testsuite errors="1" failures="0" name="" 
tests="1" time="0.000">
-<testcase classname="junitxml.tests.test_junitxml.Errors" name="test_me" 
time="0.000">
+<testcase classname="Errors" name="test_me" time="0.000">
 <error type="ZeroDivisionError">error</error>
 </testcase>
 </testsuite>
 """, self.get_output())
 
     def test_failing_test(self):
-        class Fails(unittest.TestCase):
+        class Fails(ConsistantIdTestCase):
             def test_me(self):
                 self.fail()
         self.result.startTestRun()
         Fails("test_me").run(self.result)
         self.result.stopTestRun()
         self.assertEqual("""<testsuite errors="0" failures="1" name="" 
tests="1" time="0.000">
-<testcase classname="junitxml.tests.test_junitxml.Fails" name="test_me" 
time="0.000">
+<testcase classname="Fails" name="test_me" time="0.000">
 <failure type="AssertionError">failure</failure>
 </testcase>
 </testsuite>
 """, self.get_output())
 
     def test_successful_test(self):
-        class Passes(unittest.TestCase):
+        class Passes(ConsistantIdTestCase):
             def test_me(self):
                 pass
         self.result.startTestRun()
         Passes("test_me").run(self.result)
         self.result.stopTestRun()
         self.assertEqual("""<testsuite errors="0" failures="0" name="" 
tests="1" time="0.000">
-<testcase classname="junitxml.tests.test_junitxml.Passes" name="test_me" 
time="0.000"/>
+<testcase classname="Passes" name="test_me" time="0.000"/>
 </testsuite>
 """, self.get_output())
 
-    def test_skip_test(self):
-        class Skips(unittest.TestCase):
-            def test_me(self):
-                self.skipTest("yo")
-        self.result.startTestRun()
-        test = Skips("test_me")
-        self.run_test_or_simulate(test, 'skipTest', self.result.addSkip, 'yo')
-        self.result.stopTestRun()
-        output = self.get_output()
-        expected = """<testsuite errors="0" failures="0" name="" tests="1" 
time="0.000">
-<testcase classname="junitxml.tests.test_junitxml.Skips" name="test_me" 
time="0.000">
-<skipped>yo</skipped>
-</testcase>
-</testsuite>
-"""
-        self.assertEqual(expected, output)
-
     def test_unexpected_success_test(self):
-        class Succeeds(unittest.TestCase):
+        class Succeeds(ConsistantIdTestCase):
             def test_me(self):
                 pass
             try:
@@ -178,13 +159,13 @@ class TestJUnitXmlResult(unittest.TestCa
         self.result.stopTestRun()
         output = self.get_output()
         expected = """<testsuite errors="0" failures="1" name="" tests="1" 
time="0.000">
-<testcase classname="junitxml.tests.test_junitxml.Succeeds" name="test_me" 
time="0.000">
+<testcase classname="Succeeds" name="test_me" time="0.000">
 <failure type="unittest.case._UnexpectedSuccess"/>
 </testcase>
 </testsuite>
 """
         expected_old = """<testsuite errors="0" failures="0" name="" tests="1" 
time="0.000">
-<testcase classname="junitxml.tests.test_junitxml.Succeeds" name="test_me" 
time="0.000"/>
+<testcase classname="Succeeds" name="test_me" time="0.000"/>
 </testsuite>
 """
         if output != expected_old:
@@ -192,7 +173,7 @@ class TestJUnitXmlResult(unittest.TestCa
 
     def test_expected_failure_test(self):
         expected_failure_support = [True]
-        class ExpectedFail(unittest.TestCase):
+        class ExpectedFail(ConsistantIdTestCase):
             def test_me(self):
                 self.fail("fail")
             try:
@@ -205,11 +186,11 @@ class TestJUnitXmlResult(unittest.TestCa
         self.result.stopTestRun()
         output = self.get_output()
         expected = """<testsuite errors="0" failures="0" name="" tests="1" 
time="0.000">
-<testcase classname="junitxml.tests.test_junitxml.ExpectedFail" name="test_me" 
time="0.000"/>
+<testcase classname="ExpectedFail" name="test_me" time="0.000"/>
 </testsuite>
 """
         expected_old = """<testsuite errors="0" failures="1" name="" tests="1" 
time="0.000">
-<testcase classname="junitxml.tests.test_junitxml.ExpectedFail" name="test_me" 
time="0.000">
+<testcase classname="ExpectedFail" name="test_me" time="0.000">
 <failure type="AssertionError">failure</failure>
 </testcase>
 </testsuite>

Reply via email to