diff --git a/fix-tests.patch b/fix-tests.patch new file mode 100644 index 0000000..99ab1db --- /dev/null +++ b/fix-tests.patch @@ -0,0 +1,30 @@ +From b8338bc7a6517a57ddd1537490be8b7023617104 Mon Sep 17 00:00:00 2001 +From: Daniel Garcia Moreno +Date: Wed, 25 Jan 2023 11:01:30 +0100 +Subject: [PATCH] Fix tests: Do not test different id in test_dir + +Looks like the python interpreter uses the same id if it's available, so +this test fails randomly, depending on memory management. + +".../ana-0.06/test.py", line 113, in test_dir + self.assertNotEqual(old_id, id(two)) +AssertionError: 140642905866320 == 140642905866320 + +This patch just removes the check because we cannot be sure that they +are different. +--- + test.py | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/test.py b/test.py +index 8c5f9ee..1250c34 100644 +--- a/test.py ++++ b/test.py +@@ -110,7 +110,6 @@ def test_dir(self): + ana.dl = ana.DirDataLayer(pickle_dir="/tmp/test_ana") + two = A.ana_load(uuid) + self.assertEquals(uuid, two.ana_uuid) +- self.assertNotEqual(old_id, id(two)) + + # reset the datalayer to make sure we handle it properly + ana.set_dl(ana.DictDataLayer()) diff --git a/python-ana.changes b/python-ana.changes index a1f895a..1072ba5 100644 --- a/python-ana.changes +++ b/python-ana.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Jan 25 10:50:32 UTC 2023 - Daniel Garcia + +- Add fix-tests.patch to fix tests with python3.11 gh#zardus/ana#15 + ------------------------------------------------------------------- Wed Mar 25 13:44:05 UTC 2020 - Paolo Stivanin diff --git a/python-ana.spec b/python-ana.spec index 4f65700..ab21002 100644 --- a/python-ana.spec +++ b/python-ana.spec @@ -1,7 +1,7 @@ # # spec file for package python-ana # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,7 +16,7 @@ # -%{?!python_module:%define python_module() python-%{**} python3-%{**}} +%define internal_version 0.6 Name: python-ana Version: 0.06 Release: 0 @@ -30,6 +30,8 @@ Source2: https://raw.githubusercontent.com/zardus/ana/master/test.py Source3: https://raw.githubusercontent.com/zardus/ana/master/test_pickle.p # https://github.com/zardus/ana/pull/14 Patch0: use_unittest.patch +# https://github.com/zardus/ana/pull/15 +Patch1: fix-tests.patch BuildRequires: %{python_module future} BuildRequires: %{python_module setuptools} BuildRequires: fdupes @@ -46,6 +48,7 @@ A Python module that provides an undocumented data layer for Python objects. [ -e test.py ] || cp %{SOURCE2} test.py [ -e test_pickle.p ] || cp %{SOURCE3} test_pickle.p %patch0 +%patch1 -p1 %build %python_build @@ -60,6 +63,7 @@ A Python module that provides an undocumented data layer for Python objects. %files %{python_files} %license LICENSE %doc README.md -%{python_sitelib}/* +%{python_sitelib}/ana +%{python_sitelib}/ana-%{internal_version}*-info %changelog