mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
Pull Request resolved: https://github.com/pytorch/pytorch/pull/140426 Approved by: https://github.com/eellison
27 lines
659 B
Python
27 lines
659 B
Python
# mypy: ignore-errors
|
|
from __future__ import annotations
|
|
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
from tools.linter.adapters.docstring_linter import DocstringLinter
|
|
|
|
|
|
_PARENT = Path(__file__).parent.absolute()
|
|
_PATH = [Path(p).absolute() for p in sys.path]
|
|
|
|
if _PARENT in _PATH:
|
|
from linter_test_case import LinterTestCase
|
|
else:
|
|
from .linter_test_case import LinterTestCase
|
|
|
|
TEST_FILE = Path("tools/test/docstring_linter_testdata/python_code.py.txt")
|
|
|
|
|
|
class TestDocstringLinter(LinterTestCase):
|
|
LinterClass = DocstringLinter
|
|
|
|
def test_python_code(self):
|
|
args = "--max-class=3 --max-def=4".split()
|
|
self.lint_test(TEST_FILE, args)
|