Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b5bce9c

Browse files
committed
test_matrix: pass -v to run_tests.py
1 parent aae4db4 commit b5bce9c

3 files changed

Lines changed: 18 additions & 4 deletions

File tree

README.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ Run tests
7070
Run the command::
7171

7272
python3 tests/test_matrix.py
73+
# add -v option for verbose mode
7374

7475
To test one specific Python executable::
7576

7677
python3.6 tests/run_tests.py
78+
# add -v option for verbose mode

tests/run_tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/python3
22
"""
3-
Run tests suite.
3+
Run the test suite.
44
55
Usage::
66

tests/test_matrix.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
#!/usr/bin/python3
2+
"""
3+
Run the test suite on multiple Python versions.
4+
5+
Usage::
6+
7+
python3 test_matrix.py
8+
python3 test_matrix.py -v # verbose mode
9+
"""
210
import os.path
311
import subprocess
412
import sys
@@ -15,8 +23,7 @@
1523
)
1624

1725

18-
def test_python(python, run_tests):
19-
cmd = [python, run_tests]
26+
def run_command(cmd):
2027
proc = subprocess.Popen(cmd)
2128
proc.wait()
2229
exitcode = proc.returncode
@@ -25,6 +32,8 @@ def test_python(python, run_tests):
2532

2633

2734
def main():
35+
verbose = "-v" in sys.argv[1:]
36+
2837
run_tests = os.path.join(os.path.dirname(__file__), "run_tests.py")
2938
tested = set()
3039
for python in PYTHONS:
@@ -36,7 +45,10 @@ def main():
3645
if executable is tested:
3746
continue
3847

39-
test_python(executable, run_tests)
48+
cmd = [executable, run_tests]
49+
if verbose:
50+
cmd.append('-v')
51+
run_command(cmd)
4052
tested.add(executable)
4153

4254
print()

0 commit comments

Comments
 (0)