File: test_defaults.py

package info (click to toggle)
python-flake8 7.1.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,212 kB
  • sloc: python: 6,592; sh: 21; makefile: 19
file content (36 lines) | stat: -rw-r--r-- 556 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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