On 8/5/06, Michele Cella <[EMAIL PROTECTED]> wrote:

Jorge Vargas wrote:
> On 8/4/06, Kevin Dangoor <[EMAIL PROTECTED]> wrote:
> >
> >
> > I'm not sure what you mean. That except clause up there will only handle
> > ValueErrors. Anything else that comes up will "error" the test. (Not a
> > failure, mind you, but it still wouldn't pass..)
> >
>
> because even if it goes in the last assert will make it always fail
>     try:
>         raise NotImplementedError
>     except NotImplementedError:
>         assert True,"True passes"
>     assert False,"but here it crashes"
>
> >python -u " assertTest.py"
> Traceback (most recent call last):
>   File "assertTest.py", line 5, in ?
>     assert False,"but here it crashes"
> AssertionError: but here it crashes
> >Exit code: 1
>

I'm not sure if I'm understanding what you're really trying to do,
anyway:

just proving that the code will fail.

try:
    raise NotImplementedError
except NotImplementedError:
    assert True,"True passes"
else:
    assert False,"but here it crashes"

> python -u assertTest.py

that should work, although I like the more explicit use of TestCase.failUnlessRaises and the @nose.tools.raises(NotImplementedError)



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~----------~----~----~----~------~----~------~--~---

Reply via email to