Indeed, Nautilus logic to run test differs a bit from the TestRunner logic.
For example, if your test fails, it is run a second time to open a debugger but 
it could do side effects.

Why don't you just run your tests from the test runner or using MyTestClass 
run: #testSelector ?

We will need to clean this kind of logic that should not be part of Nautilus. 
Could you open a bug entry for that?

Regards,
Christophe.

Le 21 avr. 2015 à 15:34, Otto Behrens a écrit :

> I realised I may have posted this on the wrong list. Is there anyone
> that can help with this one please?
> 
> 
> ---------- Forwarded message ----------
> From: Otto Behrens <[email protected]>
> Date: Sun, Apr 19, 2015 at 10:08 AM
> Subject: exception handling problem when running tests in Nautilus
> To: [email protected]
> 
> 
> Hi,
> 
> Thanks everyone for the new Pharo and all the work done. I like Spotter!
> 
> I gave Pharo 4 a try today and ran into a problem with running tests
> in a TestCase (test class -> run tests). I just get the debugger
> popping up with WARequestContextNotFound.
> 
> In the setUp of our test case, we call WACurrentRequestContext value,
> but handle the error when we do not have a context, for example:
> 
> [ WACurrentRequestContext value. true ]
> on: WARequestContextNotFound
> do: [ :e | false ]
> 
> This handler: "[ :e | false ]" is never called. What influences this
> is the exception handling in:
> 
> AbstractNautilusUI >> #runTestsOfClass:notifying:
> 
> Firstly, I think that it may be slighly better to call "e pass" or "e
> outer" in stead of "e defaultAction", as this would give another outer
> handler a chance to do something. The defaultAction is called when
> there are no more outer handlers anyway.
> 
> After trying this, it did not help my cause. And I think that this is
> because the WACurrentRequestContext is a Notification and not an
> Error.
> 
> I then replaced Exception with Error in the handler in
> AbstractNautilusUI. This seem to work. What also works is to
> completely remove the exception handling in AbstractNautilusUI >>
> #runTestsOfClass:notifying:
> 
> What is a bit strange is the inconsistency in this exception handling
> when running a suite or an individual test. Perhaps this kind of code
> could be better on the TestSuite and not in the Nautilus UI?
> 
> Can anyone please help? Should I be doing something else?
> 
> Cheers
> Otto
> 

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to