Opened 9 years ago

Last modified 9 years ago

#1263 defect closed fixed (fixed)

trial --until-failure is broken

Reported by: exarkun Owned by:
Priority: high Milestone:
Component: core Keywords:
Cc: exarkun, jml Branch:
Author: Launchpad Bug:

Description


Change History (10)

comment:1 Changed 9 years ago by exarkun

exarkun@boson:~/Scratch/Test$ trial --until-failure xyz
Test Pass 1
Running 0 tests.

===============================================================================
IMPORT ERROR:

Could not import xyz: 
  File "/home/exarkun/Projects/Twisted/trunk/twisted/trial/runner.py", line 474,
in loadByName
    thing = self.findByName(name)
  File "/home/exarkun/Projects/Twisted/trunk/twisted/trial/runner.py", line 346,
in findByName
    return reflect.namedAny(name)
  File "/home/exarkun/Projects/Twisted/trunk/twisted/python/reflect.py", line
361, in namedAny
    topLevelPackage = __import__(trialname)
exceptions.ValueError: Empty module name

-------------------------------------------------------------------------------
Ran 0 tests in 0.000s

PASSED
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
525, in run
    suite = reallyRun(config)
  File "/home/exarkun/Projects/Twisted/trunk/twisted/scripts/trial.py", line
506, in reallyRun
    call_until_failure(root.run, suite)
  File "/home/exarkun/Projects/Twisted/trunk/twisted/scripts/trial.py", line
461, in call_until_failure
    while suite.reporter.wasSuccessful():
AttributeError: 'NoneType' object has no attribute 'reporter'
exarkun@boson:~/Scratch/Test$ 


exarkun@boson:~/Scratch/Test$ trial --until-failure
twisted.names.test.test_dns.Encoding.testNULL
Test Pass 1
Running 1 tests.
    Encoding
      testNULL ...                                                         [OK]

-------------------------------------------------------------------------------
Ran 1 tests in 0.030s

PASSED (successes=1)
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
525, in run
    suite = reallyRun(config)
  File "/home/exarkun/Projects/Twisted/trunk/twisted/scripts/trial.py", line
506, in reallyRun
    call_until_failure(root.run, suite)
  File "/home/exarkun/Projects/Twisted/trunk/twisted/scripts/trial.py", line
461, in call_until_failure
    while suite.reporter.wasSuccessful():
AttributeError: 'NoneType' object has no attribute 'reporter'
exarkun@boson:~/Scratch/Test$

comment:2 Changed 9 years ago by exarkun

That other behavior fixed.  Now just this bad behavior:

exarkun@boson:~$ trial -u
Test Pass 1
Running 0 tests. 

-------------------------------------------------------------------------------
Ran 0 tests in 0.000s

PASSED
Test Pass 2
Running 0 tests.

-------------------------------------------------------------------------------
Ran 0 tests in 0.000s

PASSED
Test Pass 3
Running 0 tests.

-------------------------------------------------------------------------------
Ran 0 tests in 0.000s

PASSED
Test Pass 4
Running 0 tests.

-------------------------------------------------------------------------------
Ran 0 tests in 0.000s

PASSED
Test Pass 5
Running 0 tests.

-------------------------------------------------------------------------------
Ran 0 tests in 0.000s

PASSED
Test Pass 6
.
.
.

comment:3 Changed 9 years ago by exarkun

Another problem is that skips accumulate between runs, and get re-reported after
each run.  That is, if you run 3 tests with -u, and one of them is set to skip,
it will be reported as skipped once after the first run, twice after the second
run, three times after the third run, etc.

Also, test case class names are not included in output for any run but the first.

comment:4 Changed 9 years ago by exarkun

This is a regression, which is why it was classified as urgent.

comment:5 Changed 9 years ago by jml

I believe the sole remaining problem, noted in msg4678, is not a regression.

comment:6 Changed 9 years ago by exarkun

Woops sorry, I thought this ticket included this bug, too:

exarkun@boson:~$ cat test_zam.py
from twisted.trial import unittest

class X(unittest.TestCase):
  def testX(self):
    pass
  testX.todo = "yep"
exarkun@boson:~$ trial -u test_zam.py
Test Pass 1
Running 1 tests.
  test_zam
    X
      testX ...                                                    [SUCCESS!?!]

===============================================================================
[SUCCESS!?!]: test_zam.X.testX

Reason: 'yep'
-------------------------------------------------------------------------------
Ran 1 tests in 0.088s

PASSED (unexpectedSuccesses=1)
Test Pass 2
Running 1 tests.
  test_zam
    X
      testX ...                                                    [SUCCESS!?!]

===============================================================================
[SUCCESS!?!]: test_zam.X.testX

Reason: 'yep'
===============================================================================
[SUCCESS!?!]: test_zam.X.testX

Reason: 'yep'
-------------------------------------------------------------------------------
Ran 2 tests in 0.049s
.
.
.

Each run includes its own results as well as the cumulative results of all
previous runs.

comment:7 Changed 9 years ago by jml

Yeah it did.  But that's fixed, as far as I can tell.  ... ummm... r15134.

comment:8 Changed 9 years ago by exarkun

Cool.

comment:9 Changed 9 years ago by jml

Resolved in r15140

comment:10 Changed 4 years ago by <automation>

  • Owner jml deleted
Note: See TracTickets for help on using tickets.