diff --git a/570.patch b/570.patch new file mode 100644 index 0000000..fe2adc5 --- /dev/null +++ b/570.patch @@ -0,0 +1,25 @@ +From f6f260f97df29500a531baf1b370c3e4e4f3dc76 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hrn=C4=8Diar?= +Date: Thu, 23 Mar 2023 13:23:12 +0100 +Subject: [PATCH] Replace TestCase method aliases removed in Python 3.12 + +Fixes: #568 +--- + CHANGELOG.md | 2 ++ + CONTRIBUTORS.md | 1 + + fs/test.py | 2 +- + 3 files changed, 4 insertions(+), 1 deletion(-) + +diff --git a/fs/test.py b/fs/test.py +index 32e6ea5c..9bfe811d 100644 +--- a/fs/test.py ++++ b/fs/test.py +@@ -1082,7 +1082,7 @@ def test_remove(self): + self.fs.makedirs("foo/bar/baz/") + + error_msg = "resource 'foo/bar/egg/test.txt' not found" +- assertRaisesRegex = getattr(self, "assertRaisesRegex", self.assertRaisesRegexp) ++ assertRaisesRegex = getattr(self, "assertRaisesRegex", self.assertRaisesRegex) + with assertRaisesRegex(errors.ResourceNotFound, error_msg): + self.fs.remove("foo/bar/egg/test.txt") + diff --git a/python-fs.spec b/python-fs.spec index b0ff3b4..225d8a1 100644 --- a/python-fs.spec +++ b/python-fs.spec @@ -12,6 +12,11 @@ License: MIT URL: https://pypi.org/project/fs/ Source0: https://github.com/PyFilesystem/pyfilesystem2/archive/v%{version}/%{srcname}-%{version}.tar.gz +# Replace TestCase method aliases removed in Python 3.12 +# https://github.com/PyFilesystem/pyfilesystem2/pull/570 +# changelog fragment removed to avoid conflict +Patch: 570.patch + BuildArch: noarch BuildRequires: python3-devel BuildRequires: python3-setuptools @@ -49,7 +54,9 @@ Summary: %{summary} %if %{with tests} %check # tests/test_ftpfs.py needs pyftpdlib (not packaged yet) -%{python3} -m pytest --ignore tests/test_ftpfs.py +# test_seek_current and test_seek_end are skipped due to regression in Python 3.12 +# upstream issue: https://github.com/python/cpython/issues/102956 +%{python3} -m pytest --ignore tests/test_ftpfs.py -k "not test_seek_current and not test_seek_end" %endif %files -n python3-%{srcname}