]>
crepu.dev Git - config.git/blob - djavu-asus/emacs/elpy/rpc-venv/lib/python3.11/site-packages/pyflakes/test/harness.py
5 from pyflakes
import checker
7 __all__
= ['TestCase', 'skip', 'skipIf']
10 skipIf
= unittest
.skipIf
13 class TestCase(unittest
.TestCase
):
17 def flakes(self
, input, *expectedOutputs
, **kw
):
18 tree
= ast
.parse(textwrap
.dedent(input))
19 if kw
.get('is_segment'):
22 w
= checker
.Checker(tree
, withDoctest
=self
.withDoctest
, **kw
)
23 outputs
= [type(o
) for o
in w
.messages
]
24 expectedOutputs
= list(expectedOutputs
)
25 outputs
.sort(key
=lambda t
: t
.__name
__)
26 expectedOutputs
.sort(key
=lambda t
: t
.__name
__)
27 self
.assertEqual(outputs
, expectedOutputs
, '''\
33 {}'''.format(input, expectedOutputs
, '\n'.join([str(o
) for o
in w
.messages
])))