1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-27 14:04:05 +03:00

subunitrun: Use new samba.tests.subunitrun module.

Change-Id: Ie32f16d72c80c831adfd9a8d32735fa348962123
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Jelmer Vernooij 2014-11-01 20:57:09 -07:00
parent 8d8d800a0f
commit ed4c07b34b

View File

@ -39,9 +39,8 @@ sys.path.insert(0, "bin/python")
import optparse
import samba
samba.ensure_external_module("testtools", "testtools")
samba.ensure_external_module("subunit", "subunit/python")
from subunit.run import SubunitTestRunner
from samba.tests.subunitrun import TestProgram
import samba.getopt as options
import samba.tests
@ -74,14 +73,6 @@ credopts = options.CredentialsOptions(parser)
sambaopts = options.SambaOptions(parser)
parser.add_option_group(credopts)
parser.add_option_group(sambaopts)
try:
from subunit.run import TestProgram
except ImportError:
from unittest import TestProgram
else:
parser.add_option('-l', '--list', dest='listtests', default=False,
help='List tests rather than running them.',
action="store_true")
opts, args = parser.parse_args()
@ -91,5 +82,4 @@ else:
lp = sambaopts.get_loadparm()
samba.tests.cmdline_credentials = credopts.get_credentials(lp)
runner = SubunitTestRunner()
program = TestProgram(module=None, argv=[sys.argv[0]] + args, testRunner=runner)
TestProgram(module=None, argv=[sys.argv[0]] + args)