X7ROOT File Manager
Current Path:
/opt/cloudlinux/venv/lib/python3.11/site-packages/pyflakes/test
opt
/
cloudlinux
/
venv
/
lib
/
python3.11
/
site-packages
/
pyflakes
/
test
/
ðŸ“
..
📄
__init__.py
(0 B)
ðŸ“
__pycache__
📄
harness.py
(1004 B)
📄
test_api.py
(26.27 KB)
📄
test_builtin.py
(582 B)
📄
test_checker.py
(5.78 KB)
📄
test_code_segment.py
(4.39 KB)
📄
test_dict.py
(5.15 KB)
📄
test_doctests.py
(12.55 KB)
📄
test_imports.py
(32.91 KB)
📄
test_is_literal.py
(4.47 KB)
📄
test_match.py
(2.05 KB)
📄
test_other.py
(50.48 KB)
📄
test_type_annotations.py
(19.83 KB)
📄
test_undefined_names.py
(23.01 KB)
Editing: harness.py
import ast import textwrap import unittest from pyflakes import checker __all__ = ['TestCase', 'skip', 'skipIf'] skip = unittest.skip skipIf = unittest.skipIf class TestCase(unittest.TestCase): withDoctest = False def flakes(self, input, *expectedOutputs, **kw): tree = ast.parse(textwrap.dedent(input)) file_tokens = checker.make_tokens(textwrap.dedent(input)) if kw.get('is_segment'): tree = tree.body[0] kw.pop('is_segment') w = checker.Checker( tree, file_tokens=file_tokens, withDoctest=self.withDoctest, **kw ) outputs = [type(o) for o in w.messages] expectedOutputs = list(expectedOutputs) outputs.sort(key=lambda t: t.__name__) expectedOutputs.sort(key=lambda t: t.__name__) self.assertEqual(outputs, expectedOutputs, '''\ for input: {} expected outputs: {!r} but got: {}'''.format(input, expectedOutputs, '\n'.join([str(o) for o in w.messages]))) return w
Upload File
Create Folder