MCPcopy Index your code
hub / github.com/MagicStack/asyncpg / test_flake8

Method test_flake8

tests/test__sourcecode.py:19–40  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

17class TestCodeQuality(unittest.TestCase):
18
19 def test_flake8(self):
20 try:
21 import flake8 # NoQA
22 except ImportError:
23 raise unittest.SkipTest('flake8 module is missing')
24
25 root_path = find_root()
26 config_path = os.path.join(root_path, '.flake8')
27 if not os.path.exists(config_path):
28 raise RuntimeError('could not locate .flake8 file')
29
30 try:
31 subprocess.run(
32 [sys.executable, '-m', 'flake8', '--config', config_path],
33 check=True,
34 stdout=subprocess.PIPE,
35 stderr=subprocess.STDOUT,
36 cwd=root_path)
37 except subprocess.CalledProcessError as ex:
38 output = ex.output.decode()
39 raise AssertionError(
40 'flake8 validation failed:\n{}'.format(output)) from None
41
42 def test_mypy(self):
43 try:

Callers

nothing calls this directly

Calls 2

find_rootFunction · 0.85
runMethod · 0.80

Tested by

no test coverage detected