Oltmans wrote:
> On Feb 2, 2:14 am, Steve Holden wrote:
>> Should not tee be subclassing test, not unittest.TestCase?
>>
>
> Thank you, Steve. This worked, but I've not clue why? Can you please
> enlighten me why sub-classing 'test' made it happen? Please. Thanks
> again.
unittest.TestCase doesn
On Feb 2, 2:14 am, Steve Holden wrote:
>
> Should not tee be subclassing test, not unittest.TestCase?
>
Thank you, Steve. This worked, but I've not clue why? Can you please
enlighten me why sub-classing 'test' made it happen? Please. Thanks
again.
> regards
> Steve
> --
> Steve Holden
Wanting the same methods to be attached to different classes often is
a code smell (perhaps it is not your case and then use setattr as
others said). Perhaps you can just leave such methods outside any
class. I would suggest you to use a testing framework not based on
inheritance (i.e. use nose or
Oltmans wrote:
> Thank you for your help, Chris. Looks like I can now attach methods to
> class 'tee'. However, after attaching methods to 'tee' when I try to
> run them using suite.run() I don't see any of the methods running, I'm
> sorry but I've no clue what's failing this. Any insights will be
Thank you for your help, Chris. Looks like I can now attach methods to
class 'tee'. However, after attaching methods to 'tee' when I try to
run them using suite.run() I don't see any of the methods running, I'm
sorry but I've no clue what's failing this. Any insights will be
highly appreciated. Her
Or you could just do a mixin:
tee.__class__.__bases__ = (test,) + tee.__class__.__bases__
On Mon, Feb 1, 2010 at 3:25 PM, Chris Rebert wrote:
> On Mon, Feb 1, 2010 at 12:06 PM, Oltmans wrote:
>> Hello Python gurus,
>>
>> I'm quite new when it comes to Python so I will appreciate any help.
>>
On Feb 1, 12:06 pm, Oltmans wrote:
> Hello Python gurus,
>
> I'm quite new when it comes to Python so I will appreciate any help.
> Here is what I'm trying to do. I've two classes like below
>
> import new
> import unittest
>
> class test(unittest.TestCase):
> def test_first(self):
> p
On Mon, Feb 1, 2010 at 12:06 PM, Oltmans wrote:
> Hello Python gurus,
>
> I'm quite new when it comes to Python so I will appreciate any help.
> Here is what I'm trying to do. I've two classes like below
>
> import new
> import unittest
>
> class test(unittest.TestCase):
> def test_first(self):