Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
badw-it
DHParser
Commits
9760c373
Commit
9760c373
authored
Aug 20, 2018
by
eckhart
Browse files
test/run.py ammended
parent
3c92be00
Changes
1
Show whitespace changes
Inline
Side-by-side
test/run.py
View file @
9760c373
...
@@ -4,21 +4,42 @@
...
@@ -4,21 +4,42 @@
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
import
os
import
os
import
platform
scriptdir
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
# if os.getcwd().endswith('test'):
# if os.getcwd().endswith('test'):
# os.chdir('..')
# os.chdir('..')
# print("Running nosetests:")
# print("Running nosetests:")
# os.system("nosetests test")
# os.system("nosetests test")
if
platform
.
system
()
!=
"Windows"
:
# interpreters = ['python ', 'pypy3 ', 'python37 ']
interpreters
=
[
'python '
,
'pypy3 '
,
'python37 '
]
else
:
interpreters
=
[
r
'C:\Users\di68kap\AppData\Local\Programs\Python\Python37-32\python.exe '
]
interpreters
=
[
r
'C:\Users\di68kap\AppData\Local\Programs\Python\Python37-32\python.exe '
]
cwd
=
os
.
getcwd
()
for
interpreter
in
interpreters
:
for
interpreter
in
interpreters
:
os
.
system
(
interpreter
+
'--version'
)
os
.
system
(
interpreter
+
'--version'
)
# unit tests
os
.
chdir
(
scriptdir
)
assert
os
.
getcwd
().
endswith
(
'test'
)
assert
os
.
getcwd
().
endswith
(
'test'
)
files
=
os
.
listdir
()
files
=
os
.
listdir
()
for
filename
in
files
:
for
filename
in
files
:
if
filename
.
startswith
(
'test_'
):
if
filename
.
startswith
(
'test_'
):
print
(
'
\n
TEST '
+
filename
)
print
(
'
\n
UNIT
TEST '
+
filename
)
os
.
system
(
interpreter
+
filename
)
os
.
system
(
interpreter
+
filename
)
# doctests
os
.
chdir
(
'..'
)
files
=
os
.
listdir
(
'DHParser'
)
for
filename
in
files
:
if
filename
.
endswith
(
'.py'
):
print
(
'
\n
DOCTESTS in '
+
filename
)
os
.
system
(
interpreter
+
' -m doctest '
+
filename
)
os
.
chdir
(
cwd
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment