Ticket #1948: trial-order.diff

File trial-order.diff, 1.9 KB (added by warner, 7 years ago)

basic patch to leave test cases in argv order

  • twisted/trial/runner.py

     
    648648        errors = []
    649649        for name in names:
    650650            try:
    651                 things.append(self.findByName(name))
     651                fn = self.findByName(name)
     652                if fn not in things:
     653                    things.append(fn)
    652654            except:
    653655                errors.append(ErrorHolder(name, failure.Failure()))
    654656        suites = [self.loadAnything(thing, recurse)
    655                   for thing in set(things)]
     657                  for thing in things]
    656658        suites.extend(errors)
    657659        return self.suiteFactory(suites)
    658660
  • twisted/scripts/trial.py

     
    136136    tracer = None
    137137
    138138    def __init__(self):
    139         self['tests'] = set()
     139        self['tests'] = list()
    140140        usage.Options.__init__(self)
    141141
    142142    def opt_coverage(self):
     
    196196            return
    197197        filename = os.path.abspath(filename)
    198198        if isTestFile(filename):
    199             self['tests'].add(filename)
     199            self['tests'].append(filename)
    200200        else:
    201             self['tests'].update(getTestModules(filename))
     201            self['tests'].extend(getTestModules(filename))
    202202
    203203    def opt_spew(self):
    204204        """Print an insanely verbose log of everything that happens.  Useful
     
    273273            sys.modules[module] = None
    274274
    275275    def parseArgs(self, *args):
    276         self['tests'].update(args)
     276        self['tests'].extend(args)
    277277        if self.extra is not None:
    278             self['tests'].update(self.extra)
     278            self['tests'].extend(self.extra)
    279279
    280280    def _loadReporterByName(self, name):
    281281        for p in plugin.getPlugins(itrial.IReporter):