mirror of
https://github.com/PyCQA/flake8.git
synced 2026-03-29 10:36:53 +00:00
36 lines
556 B
Python
36 lines
556 B
Python
from __future__ import annotations
|
||
|
||
import pytest
|
||
|
||
from flake8.defaults import VALID_CODE_PREFIX
|
||
|
||
|
||
@pytest.mark.parametrize(
|
||
"s",
|
||
(
|
||
"E",
|
||
"E1",
|
||
"E123",
|
||
"ABC",
|
||
"ABC1",
|
||
"ABC123",
|
||
),
|
||
)
|
||
def test_valid_plugin_prefixes(s):
|
||
assert VALID_CODE_PREFIX.match(s)
|
||
|
||
|
||
@pytest.mark.parametrize(
|
||
"s",
|
||
(
|
||
"",
|
||
"A1234",
|
||
"ABCD",
|
||
"abc",
|
||
"a-b",
|
||
"☃",
|
||
"A𝟗",
|
||
),
|
||
)
|
||
def test_invalid_plugin_prefixes(s):
|
||
assert VALID_CODE_PREFIX.match(s) is None
|