This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pitrou
Recipients benjamin.peterson, bob.ippolito, doerwalter, pitrou, rhettinger
Date 2009-04-11.09:09:37
SpamBayes Score 5.993539e-13
Marked as misclassified No
Message-id <1239393177.7235.5.camel@fsol>
In-reply-to <1239324632.1.0.819939614205.issue5723@psf.upfronthosting.co.za>
Content
Hi,

> I don't think the decorator approach would work for the doctests, it looks 
> like it could be an interesting approach though. I have a feeling that 
> it's going to have to be done in some kind of ugly subclass though, I'll 
> dig into unittest deeper this weekend to see how that might be done.

Doctests will be annoying indeed. I never use doctests so I can't
suggest you anything.
As for standard unit tests, the common idiom is something like:

class JSONEncodingTests:
    def test_encode1(self):
        self.assertEquals(self.encode("foo"), "bar")
    # etc.

class CJSONEncodingTests(JSONEncodingTests, unittest.TestCase):
    encode = json.c_encode

class PyJSONEncodingTests(JSONEncodingTests, unittest.TestCase):
    encode = json.py_encode

(I'm CC'ing you since bugs.python.org looks down)

Regards

Antoine.
History
Date User Action Args
2009-04-11 09:09:40pitrousetrecipients: + pitrou, doerwalter, rhettinger, benjamin.peterson
2009-04-11 09:09:38pitroulinkissue5723 messages
2009-04-11 09:09:37pitroucreate