This reverts commit 204c8a9
"Refactor deprecated unittest aliases for
Python 3.11 compatibility".
epel9
parent
7e819b031a
commit
d578b9b884
@ -1,27 +0,0 @@
|
||||
From 46bad125f2d599a409704b6c1dcda47b709b4aec Mon Sep 17 00:00:00 2001
|
||||
From: Karthikeyan Singaravelan <tir.karthi@gmail.com>
|
||||
Date: Sun, 10 Oct 2021 08:19:25 +0000
|
||||
Subject: [PATCH] Refactor deprecated unittest aliases for Python 3.11
|
||||
compatibility.
|
||||
|
||||
---
|
||||
pathspec/tests/test_gitwildmatch.py | 7 ++++++-
|
||||
1 file changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/pathspec/tests/test_gitwildmatch.py b/pathspec/tests/test_gitwildmatch.py
|
||||
index 9868381..f9b4b66 100644
|
||||
--- a/pathspec/tests/test_gitwildmatch.py
|
||||
+++ b/pathspec/tests/test_gitwildmatch.py
|
||||
@@ -543,6 +543,11 @@ def test_09_single_exclamation_mark_fail(self):
|
||||
|
||||
def _check_invalid_pattern(self, git_ignore_pattern):
|
||||
expected_message_pattern = re.escape(repr(git_ignore_pattern))
|
||||
- with self.assertRaisesRegexp(GitWildMatchPatternError, expected_message_pattern):
|
||||
+ # assertRaisesRegexp was a deprecated alias removed in Python 3.11
|
||||
+ if hasattr(self, 'assertRaisesRegex'):
|
||||
+ assertRaisesRegex = self.assertRaisesRegex
|
||||
+ else:
|
||||
+ assertRaisesRegex = self.assertRaisesRegexp
|
||||
+ with assertRaisesRegex(GitWildMatchPatternError, expected_message_pattern):
|
||||
GitWildMatchPattern(git_ignore_pattern)
|
||||
|
Loading…
Reference in new issue