forked from pixee/codemodder-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_codemod_docs.py
More file actions
25 lines (19 loc) · 831 Bytes
/
test_codemod_docs.py
File metadata and controls
25 lines (19 loc) · 831 Bytes
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
import pytest
from codemodder.codemods.api import BaseCodemod
from codemodder.registry import load_registered_codemods
from codemodder.scripts.generate_docs import ALL_CODEMODS_METADATA
def pytest_generate_tests(metafunc):
registry = load_registered_codemods()
if "codemod" in metafunc.fixturenames:
ids = [codemod.id for codemod in registry.codemods]
metafunc.parametrize("codemod", registry.codemods, ids=ids)
def test_load_codemod_docs_info(codemod: BaseCodemod):
if codemod.name in ["order-imports"]:
pytest.xfail(reason=f"{codemod.name} has no description")
assert codemod.description
assert codemod.review_guidance in (
"Merge After Review",
"Merge After Cursory Review",
"Merge Without Review",
)
assert codemod.name in ALL_CODEMODS_METADATA