Opened 15 years ago

Last modified 15 years ago

#2392 defect new

trial aborts abnormally if it encounters a TestCase.run which raises an exception

Reported by: Jean-Paul Calderone Owned by:
Priority: normal Milestone:
Component: trial Keywords:
Cc: Branch:
Author:

Description

For example:

   test_simple_flat_one ...                                               [OK]
Traceback (most recent call last):
  File "/home/exarkun/Projects/Twisted/trunk/bin/trial", line 24, in ?
    run()
  File "/home/exarkun/Projects/Twisted/trunk/twisted/scripts/trial.py", line 345, in run
    test_result = trialRunner.run(suite)
  File "/home/exarkun/Projects/Twisted/trunk/twisted/trial/runner.py", line 794, in run
    suite.run(result)
  File "/home/exarkun/Projects/Twisted/trunk/twisted/trial/runner.py", line 285, in run
    TestSuite.run(self, result)
  File "/home/exarkun/Projects/Twisted/trunk/twisted/trial/runner.py", line 149, in run
    test(result)
  File "/home/exarkun/Projects/Twisted/trunk/twisted/trial/runner.py", line 138, in __call__
    return self.run(result)
  File "/home/exarkun/Projects/Twisted/trunk/twisted/trial/runner.py", line 176, in run
    super(LoggedSuite, self).run(result)
  File "/home/exarkun/Projects/Twisted/trunk/twisted/trial/runner.py", line 149, in run
    test(result)
  File "/home/exarkun/Projects/Twisted/trunk/twisted/trial/runner.py", line 138, in __call__
    return self.run(result)
  File "/home/exarkun/Projects/Twisted/trunk/twisted/trial/runner.py", line 149, in run
    test(result)
  File "/home/exarkun/Projects/Twisted/trunk/twisted/trial/runner.py", line 138, in __call__
    return self.run(result)
  File "/home/exarkun/Projects/Twisted/trunk/twisted/trial/runner.py", line 149, in run
    test(result)
  File "/home/exarkun/Projects/Twisted/trunk/twisted/trial/runner.py", line 138, in __call__
    return self.run(result)
  File "/home/exarkun/Projects/Twisted/trunk/twisted/trial/runner.py", line 149, in run                                        
    test(result)
  File "/home/exarkun/Projects/Twisted/trunk/twisted/trial/runner.py", line 138, in __call__
    return self.run(result)
  File "/home/exarkun/Projects/Twisted/trunk/twisted/trial/runner.py", line 149, in run
    test(result)
  File "/home/exarkun/Projects/Twisted/trunk/twisted/trial/unittest.py", line 537, in __call__
    return self.run(*args, **kwargs)
  File "/home/exarkun/Projects/Divmod/trunk/Nevow/nevow/test/test_javascript.py", line 83, in run
    script = self.makeScript(self.testMethod())
  File "/home/exarkun/Projects/Divmod/trunk/Nevow/nevow/test/test_javascript.py", line 59, in makeScript
    scriptFile = self._writeToTemp(consolejstest.generateTestScript(jsfile))
  File "/home/exarkun/Projects/Divmod/trunk/Nevow/nevow/scripts/consolejstest.py", line 98, in generateTestScript
    dependencies= getDependencies(fname)
  File "/home/exarkun/Projects/Divmod/trunk/Nevow/nevow/scripts/consolejstest.py", line 52, in getDependencies
    return (bootstrapModules +
  File "/home/exarkun/Projects/Divmod/trunk/Nevow/nevow/athena.py", line 200, in allDependencies
    return dependencyOrdered(mods)
  File "/home/exarkun/Projects/Divmod/trunk/Nevow/nevow/athena.py", line 134, in dependencyOrdered
    _insertDep(dependent, ordered)
  File "/home/exarkun/Projects/Divmod/trunk/Nevow/nevow/athena.py", line 124, in _insertDep
    for dependency in dependent.dependencies():
  File "/home/exarkun/Projects/Divmod/trunk/Nevow/nevow/athena.py", line 192, in dependencies
    return self._cache.load()
  File "/home/exarkun/Projects/Divmod/trunk/Nevow/nevow/util.py", line 228, in load
    self._cachedObj = self.loader(self.path, *args, **kwargs)
  File "/home/exarkun/Projects/Divmod/trunk/Nevow/nevow/athena.py", line 185, in _getDeps
    return self.packageDeps + dict.fromkeys(depgen).keys()
  File "/home/exarkun/Projects/Divmod/trunk/Nevow/nevow/athena.py", line 176, in _extractImports
    yield self.getOrCreate(m.group(1).decode('ascii'), self.mapping)
  File "/home/exarkun/Projects/Divmod/trunk/Nevow/nevow/athena.py", line 152, in getOrCreate
    mod = cls._modules[name] = cls(name, mapping)
  File "/home/exarkun/Projects/Divmod/trunk/Nevow/nevow/athena.py", line 165, in __init__
    self._cache = CachedFile(self.mapping[self.name], self._getDeps)
KeyError: u'Divmod.UnitTest'
exarkun@charm:/tmp$

Change History (4)

comment:1 Changed 15 years ago by Jonathan Lange

Resolution: wontfix
Status: newclosed

Part of the contract of TestCase.run is that it does not throw an exception.

comment:2 Changed 15 years ago by Jean-Paul Calderone

Resolution: wontfix
Status: closedreopened

TestCase.run isn't formally documented anywhere in trial that I can see. So at the very least this should be rectified.

However, doesn't it seem less than optimal to require each run implementation to to take care of exception handling, when the small number of places in trial which call it could handle this exception?

comment:3 Changed 15 years ago by Jonathan Lange

Status: reopenednew

comment:4 Changed 11 years ago by <automation>

Owner: Jonathan Lange deleted
Note: See TracTickets for help on using tickets.