FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-uvloop/tests/test_sourcecode.py at master · sysfce2/python-uvloop · GitHub
sysfce2
/
python-uvloop
Public
forked from
MagicStack/uvloop
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
python-uvloop
/
tests
/
test_sourcecode.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
72 lines (62 loc) · 2.26 KB
Breadcrumbs
python-uvloop
/
tests
/
test_sourcecode.py
Copy path
File metadata and controls
72 lines (62 loc) · 2.26 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import
os
import
subprocess
import
sys
import
unittest
def
find_uvloop_root
():
return
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)))
class
TestSourceCode
(
unittest
.
TestCase
):
def
test_flake8
(
self
):
edgepath
=
find_uvloop_root
()
config_path
=
os
.
path
.
join
(
edgepath
,
'.flake8'
)
if
not
os
.
path
.
exists
(
config_path
):
raise
RuntimeError
(
'could not locate .flake8 file'
)
try
:
import
flake8
# NoQA
except
ImportError
:
raise
unittest
.
SkipTest
(
'flake8 module is missing'
)
for
subdir
in
[
'examples'
,
'uvloop'
,
'tests'
]:
try
:
subprocess
.
run
(
[
sys
.
executable
,
'-m'
,
'flake8'
,
'--config'
,
config_path
],
check
=
True
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
,
cwd
=
os
.
path
.
join
(
edgepath
,
subdir
))
except
subprocess
.
CalledProcessError
as
ex
:
output
=
ex
.
stdout
.
decode
()
output
+=
'
\n
'
output
+=
ex
.
stderr
.
decode
()
raise
AssertionError
(
'flake8 validation failed: {}
\n
{}'
.
format
(
ex
,
output
)
)
from
None
def
test_mypy
(
self
):
edgepath
=
find_uvloop_root
()
config_path
=
os
.
path
.
join
(
edgepath
,
'mypy.ini'
)
if
not
os
.
path
.
exists
(
config_path
):
raise
RuntimeError
(
'could not locate mypy.ini file'
)
try
:
import
mypy
# NoQA
except
ImportError
:
raise
unittest
.
SkipTest
(
'mypy module is missing'
)
try
:
subprocess
.
run
(
[
sys
.
executable
,
'-m'
,
'mypy'
,
'--config-file'
,
config_path
,
'uvloop'
],
check
=
True
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
,
cwd
=
edgepath
)
except
subprocess
.
CalledProcessError
as
ex
:
output
=
ex
.
stdout
.
decode
()
output
+=
'
\n
'
output
+=
ex
.
stderr
.
decode
()
raise
AssertionError
(
'mypy validation failed: {}
\n
{}'
.
format
(
ex
,
output
)
)
from
None
Back
|
FazBrowse Home
|
New Git URL