File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,12 +22,15 @@ class TestCommand(Command):
2222 "Run read/write functional tests against actual bugzilla instances. "
2323 "As of now this only runs against partner-bugzilla.redhat.com, "
2424 "which requires an RH bugzilla account with cached cookies. "
25- "This will also be very slow." )
25+ "This will also be very slow." ),
26+ ("only=" , None ,
27+ "Run only tests whose name contains the passed string" ),
2628 ]
2729
2830 def initialize_options (self ):
2931 self .ro_functional = False
3032 self .rw_functional = False
33+ self .only = None
3134
3235 def finalize_options (self ):
3336 pass
@@ -65,6 +68,15 @@ def run(self):
6568 print "installHandler hack failed"
6669
6770 tests = unittest .TestLoader ().loadTestsFromNames (testfiles )
71+ if self .only :
72+ newtests = []
73+ for suite1 in tests :
74+ for suite2 in suite1 :
75+ for testcase in suite2 :
76+ if self .only in str (testcase ):
77+ newtests .append (testcase )
78+ tests = unittest .TestSuite (newtests )
79+
6880 t = unittest .TextTestRunner (verbosity = 1 )
6981
7082 result = t .run (tests )
You can’t perform that action at this time.
0 commit comments