You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
1.1 KiB
28 lines
1.1 KiB
3 years ago
|
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)
|
||
|
|