Allow running a specific functional test via CLI
Change-Id: I5897d8121b7cc992d64f948f73f1f846615f6e46
This commit is contained in:
parent
95caa2ec36
commit
4f578169c7
@ -18,6 +18,7 @@ import copy
|
|||||||
import datetime
|
import datetime
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
import time
|
import time
|
||||||
import unittest
|
import unittest
|
||||||
@ -798,5 +799,10 @@ def mocked_server():
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
if len(sys.argv) > 1:
|
||||||
|
test_name = sys.argv[1]
|
||||||
|
else:
|
||||||
|
test_name = None
|
||||||
|
|
||||||
with mocked_server():
|
with mocked_server():
|
||||||
unittest.main(verbosity=2)
|
unittest.main(verbosity=2, defaultTest=test_name)
|
||||||
|
4
tox.ini
4
tox.ini
@ -52,12 +52,12 @@ commands =
|
|||||||
[testenv:functional]
|
[testenv:functional]
|
||||||
basepython = python2.7
|
basepython = python2.7
|
||||||
commands =
|
commands =
|
||||||
python -m ironic_inspector.test.functional
|
python -m ironic_inspector.test.functional {posargs}
|
||||||
|
|
||||||
[testenv:functional-py36]
|
[testenv:functional-py36]
|
||||||
basepython = python3
|
basepython = python3
|
||||||
commands =
|
commands =
|
||||||
python3 -m ironic_inspector.test.functional
|
python3 -m ironic_inspector.test.functional {posargs}
|
||||||
|
|
||||||
[testenv:genconfig]
|
[testenv:genconfig]
|
||||||
basepython = python3
|
basepython = python3
|
||||||
|
Loading…
Reference in New Issue
Block a user