Allow running a specific functional test via CLI

Change-Id: I5897d8121b7cc992d64f948f73f1f846615f6e46
This commit is contained in:
Dmitry Tantsur 2019-07-18 14:25:41 +02:00
parent 95caa2ec36
commit 4f578169c7
2 changed files with 9 additions and 3 deletions

View File

@ -18,6 +18,7 @@ import copy
import datetime
import json
import os
import sys
import tempfile
import time
import unittest
@ -798,5 +799,10 @@ def mocked_server():
if __name__ == '__main__':
if len(sys.argv) > 1:
test_name = sys.argv[1]
else:
test_name = None
with mocked_server():
unittest.main(verbosity=2)
unittest.main(verbosity=2, defaultTest=test_name)

View File

@ -52,12 +52,12 @@ commands =
[testenv:functional]
basepython = python2.7
commands =
python -m ironic_inspector.test.functional
python -m ironic_inspector.test.functional {posargs}
[testenv:functional-py36]
basepython = python3
commands =
python3 -m ironic_inspector.test.functional
python3 -m ironic_inspector.test.functional {posargs}
[testenv:genconfig]
basepython = python3