Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-aspectlib for 
openSUSE:Factory checked in at 2021-12-16 21:19:00
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-aspectlib (Old)
 and      /work/SRC/openSUSE:Factory/.python-aspectlib.new.2520 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-aspectlib"

Thu Dec 16 21:19:00 2021 rev:6 rq:940585 version:1.5.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-aspectlib/python-aspectlib.changes        
2021-12-13 20:45:57.268496530 +0100
+++ 
/work/SRC/openSUSE:Factory/.python-aspectlib.new.2520/python-aspectlib.changes  
    2021-12-16 21:19:45.042531249 +0100
@@ -1,0 +2,6 @@
+Tue Dec 14 22:35:48 UTC 2021 - Matej Cepl <mc...@suse.com>
+
+- Add fix_two_tests_py310.patch which fixes those tests with Python 3.10
+  (gh#ionelmc/python-aspectlib#22).
+
+-------------------------------------------------------------------

New:
----
  fix_two_tests_py310.patch

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

Other differences:
------------------
++++++ python-aspectlib.spec ++++++
--- /var/tmp/diff_new_pack.IZ7Vwk/_old  2021-12-16 21:19:45.462531410 +0100
+++ /var/tmp/diff_new_pack.IZ7Vwk/_new  2021-12-16 21:19:45.462531410 +0100
@@ -25,6 +25,8 @@
 License:        BSD-2-Clause
 URL:            https://github.com/ionelmc/python-aspectlib
 Source:         
https://files.pythonhosted.org/packages/source/a/aspectlib/aspectlib-%{version}.tar.gz
+# PATCH-FIX-UPSTREAM fix_two_tests_py310.patch gh#ionelmc/python-aspectlib#22 
mc...@suse.com
+Patch0:         fix_two_tests_py310.patch
 BuildRequires:  %{python_module setuptools}
 BuildRequires:  fdupes
 BuildRequires:  python-rpm-macros
@@ -50,7 +52,8 @@
 framework.
 
 %prep
-%setup -q -n aspectlib-%{version}
+%autosetup -p1 -n aspectlib-%{version}
+
 # both tests not working (the first skipped by design, the second needed old 
tornado)
 # don't pull in tornado when not needed
 rm tests/test_integrations_py3.py
@@ -63,9 +66,7 @@
 %python_expand %fdupes %{buildroot}%{$python_sitelib}
 
 %check
-# gh#ionelmc/python-aspectlib#24
-python310_extraargs=("-k" "not (test_story and play_proxy_class)")
-%pytest --ignore=src "${$python_extraargs[@]}"
+%pytest --ignore=src
 
 %files %{python_files}
 %license LICENSE

++++++ fix_two_tests_py310.patch ++++++
>From 3753c940d08a681a4e41b16e282a2d7c63eef158 Mon Sep 17 00:00:00 2001
From: Evangelos Foutras <evange...@foutrelis.com>
Date: Wed, 8 Dec 2021 04:13:16 +0200
Subject: [PATCH] Fix two tests to work on Python 3.10

Python 3.10 adds the class name to the exception; adjust two tests
affected by this change.
---
 src/aspectlib/utils.py       |  1 +
 tests/test_aspectlib_test.py | 16 +++++++++++-----
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/src/aspectlib/utils.py b/src/aspectlib/utils.py
index 9e0837e..7259187 100644
--- a/src/aspectlib/utils.py
+++ b/src/aspectlib/utils.py
@@ -13,6 +13,7 @@
 
 PY3 = sys.version_info[0] == 3
 PY37plus = PY3 and sys.version_info[1] >= 7
+PY310plus = PY3 and sys.version_info[1] >= 10
 PY2 = sys.version_info[0] == 2
 PY26 = PY2 and sys.version_info[1] == 6
 PYPY = platform.python_implementation() == 'PyPy'
diff --git a/tests/test_aspectlib_test.py b/tests/test_aspectlib_test.py
index 05e2c25..e86ff9d 100644
--- a/tests/test_aspectlib_test.py
+++ b/tests/test_aspectlib_test.py
@@ -3,7 +3,6 @@
 from pytest import raises
 from test_pkg1.test_pkg2 import test_mod
 
-from aspectlib import PY2
 from aspectlib.test import OrderedDict
 from aspectlib.test import Story
 from aspectlib.test import StoryResultWrapper
@@ -13,7 +12,9 @@
 from aspectlib.test import _Returns
 from aspectlib.test import mock
 from aspectlib.test import record
+from aspectlib.utils import PY2
 from aspectlib.utils import PY26
+from aspectlib.utils import PY310plus
 from aspectlib.utils import repr_ex
 
 pytest_plugins = 'pytester',
@@ -414,14 +415,17 @@ def test_story_empty_play_proxy_class():
         (('stuff_1', 'mix', "'a', 'b'", ''), _Returns("(1, 2, 'a', 'b')")),
         (('stuff_1', 'meth', "123", ''), _Raises(repr_ex(TypeError(
             'meth() takes exactly 1 argument (2 given)' if PY2 else
-            'meth() takes 1 positional argument but 2 were given'
+            ('Stuff.' if PY310plus else '') +
+                'meth() takes 1 positional argument but 2 were given'
+
         )))),
         ((None, 'test_pkg1.test_pkg2.test_mod.Stuff', "0, 1", ''), 
_Binds('stuff_2')),
         (('stuff_2', 'mix', "'a', 'b'", ''), _Returns("(0, 1, 'a', 'b')")),
         (('stuff_2', 'mix', "3, 4", ''), _Returns("(0, 1, 3, 4)")),
         (('stuff_2', 'meth', "123", ''), _Raises(repr_ex(TypeError(
             'meth() takes exactly 1 argument (2 given)' if PY2 else
-            'meth() takes 1 positional argument but 2 were given'
+            ('Stuff.' if PY310plus else '') +
+                'meth() takes 1 positional argument but 2 were given'
         ))))
     ]))
 
@@ -449,14 +453,16 @@ def test_story_half_play_proxy_class():
         (('stuff_1', 'meth', '', ''), _Returns('None')),
         (('stuff_1', 'meth', '123', ''), _Raises(repr_ex(TypeError(
             'meth() takes exactly 1 argument (2 given)' if PY2 else
-            'meth() takes 1 positional argument but 2 were given'
+            ('Stuff.' if PY310plus else '') +
+                'meth() takes 1 positional argument but 2 were given'
         )))),
         ((None, 'test_pkg1.test_pkg2.test_mod.Stuff', '0, 1', ''), 
_Binds("stuff_2")),
         (('stuff_2', 'mix', "'a', 'b'", ''), _Returns("(0, 1, 'a', 'b')")),
         (('stuff_2', 'mix',  '3, 4', ''), _Returns('(0, 1, 3, 4)')),
         (('stuff_2', 'meth', '123', ''), _Raises(repr_ex(TypeError(
             'meth() takes exactly 1 argument (2 given)' if PY2 else
-            'meth() takes 1 positional argument but 2 were given'
+            ('Stuff.' if PY310plus else '') +
+                'meth() takes 1 positional argument but 2 were given'
         ))))
     ]))
 

Reply via email to