Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
unittest.assertRegex flagged as deprecated-method #1653
Comments
|
I cannot reproduce this using the same pylint version, so not sure what exactly is going on here. Can you paste the exact output you get from pylint? |
PCManticore
closed this
Sep 13, 2017
m-vdb
commented
Oct 20, 2017
|
@PCManticore I'm able to reproduce with Django==1.11.5 and pylint==1.7.4. In """d"""
from django.test import TestCase
class MyTestCase(TestCase):
"""d"""
def test_something(self):
"""d"""
self.assertRegex('string', 'other string')
def test_something_else(self):
"""d"""
self.assertRaisesRegex(ValueError, lambda: 'stuff')In your shell $ pylint --rcfile=pylint.rc check.py
************* Module check
W: 9, 8: Using deprecated method assertRegex() (deprecated-method)
W: 13, 8: Using deprecated method assertRaisesRegex() (deprecated-method)
-------------------------------------------------------------------
Your code has been rated at 6.67/10 (previous run: 10.00/10, -3.33) |
m-vdb
commented
Oct 20, 2017
|
could it be because of that ? |
bors-ltd
commented
Jan 9, 2018
|
I ran into this issue as soon as I upgraded to Django 1.11, and a colleague too. Using pylint 1.8.1 and Python 3.5. If I remove the block https://github.com/django/django/blob/1.11.5/django/test/testcases.py#L807-L811 the warnings disappear, letting think pylint would enter the This change was indeed introduced in the 1.11 series django/django@b5f0b34 |
m-vdb
commented
Jan 9, 2018
|
@PCManticore care to re-open? |
lordgordon commentedSep 11, 2017
Steps to reproduce
Current behavior
pylint flags
unittest.assertRegexasdeprecated-methodwith Python 3.6.Expected behavior
unittest.assertRegexis not deprecated in Python 3.6 and should not be flagged as deprecated. References:pylint --version output