diff --git a/doc/core/man/trial.1 b/doc/core/man/trial.1
index f01934d..1b89412 100644
|
a
|
b
|
|
| 13 | 13 | trial will take either filenames or fully qualified Python names as |
| 14 | 14 | arguments. Thus `trial myproject/foo.py', `trial myproject.foo' and |
| 15 | 15 | `trial myproject.foo.SomeTestCase.test_method' are all valid ways to |
| 16 | | invoke trial. |
| | 16 | invoke trial. Multiple such arguments are also accepted, and their order will |
| | 17 | determine the order in which the corresponding tests are run. |
| 17 | 18 | .PP |
| 18 | 19 | After running the given test suite, the default test reporter prints a summary |
| 19 | 20 | of the test run. This consists of the word "PASSED" (if all tests ran as |
diff --git a/twisted/scripts/trial.py b/twisted/scripts/trial.py
index 349b0c6..0f9ab98 100644
|
a
|
b
|
|
| 93 | 93 | return usage.CompleteList([p.longOpt for p in |
| 94 | 94 | plugin.getPlugins(itrial.IReporter)]) |
| 95 | 95 | |
| | 96 | |
| 96 | 97 | class Options(usage.Options, app.ReactorSelectionMixin): |
| 97 | 98 | synopsis = """%s [options] [[file|package|module|TestCase|testmethod]...] |
| 98 | 99 | """ % (os.path.basename(sys.argv[0]),) |
| … |
… |
|
| 146 | 147 | tracer = None |
| 147 | 148 | |
| 148 | 149 | def __init__(self): |
| 149 | | self['tests'] = set() |
| | 150 | self['tests'] = [] |
| 150 | 151 | usage.Options.__init__(self) |
| 151 | 152 | |
| 152 | 153 | |
| … |
… |
|
| 190 | 191 | return |
| 191 | 192 | filename = os.path.abspath(filename) |
| 192 | 193 | if isTestFile(filename): |
| 193 | | self['tests'].add(filename) |
| | 194 | self['tests'].append(filename) |
| 194 | 195 | else: |
| 195 | | self['tests'].update(getTestModules(filename)) |
| | 196 | self['tests'].extend(getTestModules(filename)) |
| 196 | 197 | |
| 197 | 198 | |
| 198 | 199 | def opt_spew(self): |
| … |
… |
|
| 287 | 288 | |
| 288 | 289 | |
| 289 | 290 | def parseArgs(self, *args): |
| 290 | | self['tests'].update(args) |
| | 291 | self['tests'].extend(args) |
| 291 | 292 | if self.extra is not None: |
| 292 | | self['tests'].update(self.extra) |
| | 293 | self['tests'].extend(self.extra) |
| 293 | 294 | |
| 294 | 295 | |
| 295 | 296 | def _loadReporterByName(self, name): |
diff --git a/twisted/trial/test/test_script.py b/twisted/trial/test/test_script.py
index 6c93ebe..16d4b2c 100644
|
a
|
b
|
|
| 480 | 480 | self.assertDeprecationWarning(self.config.opt_extra, |
| 481 | 481 | self.flushWarnings([self.test_xDeprecation])) |
| 482 | 482 | |
| | 483 | |
| | 484 | |
| | 485 | class TestArgumentOrderTests(unittest.TestCase): |
| | 486 | def setUp(self): |
| | 487 | self.config = trial.Options() |
| | 488 | self.loader = runner.TestLoader() |
| | 489 | |
| | 490 | def test_preserveArgumentOrder(self): |
| | 491 | """ |
| | 492 | Multiple tests passed on the command line are not reordered. |
| | 493 | |
| | 494 | """ |
| | 495 | |
| | 496 | tests = ["foo", "bar", "quux", "baz"] |
| | 497 | self.config.parseOptions(tests) |
| | 498 | |
| | 499 | suite = trial._getSuite(self.config) |
| | 500 | names = testNames(suite) |
| | 501 | |
| | 502 | expectedSuite = runner.TestSuite(map(self.loader.loadByName, tests)) |
| | 503 | expectedNames = testNames(expectedSuite) |
| | 504 | |
| | 505 | self.assertEqual(names, expectedNames) |