Testing pane when using base class as part of a unittest

View: New views
2 Messages — Rating Filter:   Alert me  

Testing pane when using base class as part of a unittest

by Ralph Berrett :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

I am trying to use the Testing window to run a unittest Class that is derived from another unittest Class.

From the Testing window, I only see the tests in the defined in derived testcase, not in the ones in the base testcase.

 

From command line I get exactly what I expect

 

C:\share\wing>unit_derived.py

testBaseInt (__main__.CDerivedTestCase) ... ok

testBaseStr (__main__.CDerivedTestCase) ... ok

testDerivedInt (__main__.CDerivedTestCase) ... ok

testDerivedStr (__main__.CDerivedTestCase) ... ok

 

----------------------------------------------------------------------

Ran 4 tests in 0.000s

 

OK

 

I am doing this because the items I am testing are derived classes themselves, and I want to test the functionality of the base class in each of the derived classes.

So I create a set of tests in a baseTestCase that is inherited by the derivedTestCase, see the attached example.

 

I tired adding the base unit test file to the Testing window.   It appears that does run all test, but they are test runs are split between the two files. 

And if one of the base test fail, but the derived tests pass the Derived TestCase still shows passed under derived testcases file, but not the base testcases file. 

I expected this to work like the command line version of unittest

 

 

Ralph Berrett

Principle Software Test Engineer

Avid Technology Inc

1925 Andover Street

Tewksbury, MA 01876

ralph_berrett@...

978-640-3674

 



_________________________________________________
Wing IDE users list
http://wingware.com/lists/wingide

derive_unittest.zip (1K) Download Attachment

Re: Testing pane when using base class as part of a unittest

by Wingware Support :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ralph Berrett wrote:
> I am trying to use the Testing window to run a unittest Class that is
> derived from another unittest Class.
>
>  From the Testing window, I only see the tests in the defined in derived
> testcase, not in the ones in the base testcase.

This is a bug that we'll try to fix soon.  It's trigged by the base
class being defined in a file that's different than the derived class --
the results actually show up under unit_base.py in the results tree when
all tests in unit_derived.py are run.  They should appear under
unit_base.py.

Thanks for the bug report!

John
_________________________________________________
Wing IDE users list
http://wingware.com/lists/wingide
LightInTheBox - Buy quality products at wholesale price!