Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use assertRegex instead of assertRegexpMatches for Python 3.11 compatibility. #104

Merged
merged 2 commits into from Oct 15, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 7 additions & 3 deletions test/test_checks.py
Expand Up @@ -11,6 +11,10 @@ def test_get_noqa_lines(self):


class TestFlake8Stdin(TestCase):
def setUp(self):
if not hasattr(self, 'assertRegex'):
self.assertRegex = self.assertRegexpMatches

twolfson marked this conversation as resolved.
Show resolved Hide resolved
def test_stdin(self):
"""Test using stdin."""
filepath = get_absolute_path('data/doubles.py')
Expand All @@ -22,13 +26,13 @@ def test_stdin(self):
stdout_lines = stdout.splitlines()
self.assertEqual(stderr, b'')
self.assertEqual(len(stdout_lines), 3)
self.assertRegexpMatches(
self.assertRegex(
stdout_lines[0],
b'stdin:1:(24|25): Q000 Double quotes found but single quotes preferred')
self.assertRegexpMatches(
self.assertRegex(
stdout_lines[1],
b'stdin:2:(24|25): Q000 Double quotes found but single quotes preferred')
self.assertRegexpMatches(
self.assertRegex(
stdout_lines[2],
b'stdin:3:(24|25): Q000 Double quotes found but single quotes preferred')

Expand Down