forked from devoxin/Lavalink.py
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun_tests.py
37 lines (30 loc) · 1.24 KB
/
run_tests.py
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
26
27
28
29
30
31
32
33
34
35
36
37
import shutil
import subprocess
executable = str(shutil.which('python3.6') or shutil.which('py')).split('/')[-1]
def test_flake8():
proc = subprocess.Popen('flake8', stdout=subprocess.PIPE)
proc.wait()
out = proc.stdout.read().decode()
print(out)
assert proc.returncode == 0
print('OK')
def test_pylint():
proc = subprocess.Popen((f'{executable} -m pylint --max-line-length=150 --score=no '
'--disable=missing-docstring,wildcard-import,'
'attribute-defined-outside-init,too-few-public-methods,'
'old-style-class,import-error,invalid-name,no-init,'
'too-many-instance-attributes,protected-access,too-many-arguments,'
'too-many-public-methods,logging-format-interpolation,too-many-branches '
'lavalink').split(),
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
proc.wait()
out = proc.stdout.read().decode()
print(out)
assert proc.returncode == 0
print('OK')
if __name__ == '__main__':
print('-- flake8 test --')
test_flake8()
print('-- pylint test --')
test_pylint()