mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-05 04:36:52 +00:00
Assign missing codes to PyFlakes messages
Some PyFlakes messages weren't covered by unique messages, making them impossible to select/ignore. This is now fixed. To ensure we don't regress in the future, a test has been added that fails if there's any uncovered messages.
This commit is contained in:
parent
b8ce1334d0
commit
2f1338c342
4 changed files with 85 additions and 18 deletions
15
tests/unit/test_pyflakes_codes.py
Normal file
15
tests/unit/test_pyflakes_codes.py
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
"""Tests of pyflakes monkey patches."""
|
||||
|
||||
import pyflakes
|
||||
|
||||
from flake8.plugins import pyflakes as pyflakes_shim
|
||||
|
||||
|
||||
def test_all_pyflakes_messages_have_flake8_codes_assigned():
|
||||
"""Verify all PyFlakes messages have error codes assigned."""
|
||||
messages = {
|
||||
name
|
||||
for name, obj in vars(pyflakes.messages).items()
|
||||
if name[0].isupper() and obj.message
|
||||
}
|
||||
assert messages == set(pyflakes_shim.FLAKE8_PYFLAKES_CODES)
|
||||
Loading…
Add table
Add a link
Reference in a new issue