[issue5723] Incomplete json tests

Walter Dörwald <report@bugs.python.org> at psf.upfronthosting.co.za Walter Dörwald <report@bugs.python.org> at psf.upfronthosting.co.za
Wed Apr 8 18:04:47 CEST 2009


Walter Dörwald <walter at livinglogic.de> added the comment:

test_quopri has a decorator that calls a test using both the C and
Python version of the tested function. This decorator looks like this:

def withpythonimplementation(testfunc):
    def newtest(self):
        # Test default implementation
        testfunc(self)
        # Test Python implementation
        if quopri.b2a_qp is not None or quopri.a2b_qp is not None:
            oldencode = quopri.b2a_qp
            olddecode = quopri.a2b_qp
            try:
                quopri.b2a_qp = None
                quopri.a2b_qp = None
                testfunc(self)
            finally:
                quopri.b2a_qp = oldencode
                quopri.a2b_qp = olddecode
    newtest.__name__ = testfunc.__name__
    return newtest

Adding such a decorator to every test method might solve the problem.

----------
nosy: +doerwalter

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5723>
_______________________________________


More information about the Python-bugs-list mailing list