Skip to content

Commit ba6c16e

Browse files
committed
Allows test names to be passed to python -m sitl.
1 parent 2db66b6 commit ba6c16e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/sitl/__main__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,9 @@ def lets_run_a_test(name):
218218
return p.returncode
219219

220220
retry = int(os.environ.get('TEST_RETRY', '1'))
221-
for path in os.listdir(testpath):
221+
filelist = sys.argv[1:] if len(sys.argv) > 1 else os.listdir(testpath)
222+
for path in filelist:
223+
assert os.path.isfile(os.path.join(testpath, path)), '"%s" is not a valid test file' % (path,)
222224
if path.startswith('test_') and path.endswith('.py'):
223225
name = path[:-3]
224226
i = retry

0 commit comments

Comments
 (0)