Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions docs/source/user/error-codes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,6 @@ generates its own :term:`error code`\ s for ``pyflakes``:
+------+---------------------------------------------------------------------+
| F722 | syntax error in forward annotation |
+------+---------------------------------------------------------------------+
| F723 | syntax error in type comment |
+------+---------------------------------------------------------------------+
+------+---------------------------------------------------------------------+
| F811 | redefinition of unused ``name`` from line ``N`` |
+------+---------------------------------------------------------------------+
Expand Down
10 changes: 10 additions & 0 deletions tests/unit/test_pyflakes_codes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
from __future__ import annotations

import ast
import os.path
import re

import pyflakes

Expand All @@ -18,6 +20,14 @@ def test_all_pyflakes_messages_have_flake8_codes_assigned():
assert messages == set(pyflakes_shim.FLAKE8_PYFLAKES_CODES)


def test_all_codes_documented():
here = os.path.dirname(__file__)
fname = os.path.join(here, '../../docs/source/user/error-codes.rst')
with open(fname) as f:
codes = set(re.findall(r'\bF\d{3}\b', f.read()))
assert set(pyflakes_shim.FLAKE8_PYFLAKES_CODES.values()) == codes


def test_undefined_local_code():
"""In pyflakes 2.1.0 this code's string formatting was changed."""
src = """\
Expand Down
Loading