Roundup Robot devnull@devnull added the comment:
New changeset 5b0fecd2eba0 by Ezio Melotti in branch '2.7':
#5723: Improve json tests to be executed with and without accelerations.
http://hg.python.org/cpython/rev/5b0fecd2eba0
New changeset c2853a54b29e by Ezio Melotti in branch '3.1':
#5723:
Changes by Ezio Melotti ezio.melo...@gmail.com:
--
resolution: - fixed
stage: commit review - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5723
___
Antoine Pitrou pit...@free.fr added the comment:
Comments:
- I don't like the fact that skip_unless_cjson() uses unittest internals. Why
can't you write something like:
skip_unless_cjson = skipUnless(...)
- instead of self.mod, self.json would be nicer
- you could also export self.loads,
Ezio Melotti ezio.melo...@gmail.com added the comment:
Why can't you write something like:skip_unless_cjson = skipUnless(...)
This indeed works -- using unittest internals was just a temporary workaround
because the example in the unittest doc didn't seem to work.
- instead of self.mod,
Antoine Pitrou pit...@free.fr added the comment:
class TestSomething(TestCase):
def test_something(self): ...
class TestPySomething(TestSomething, PyTest): pass
class TestCSomething(TestSomething, CTest): pass
I was thinking about that. That looks clean and explicit to me.
Ezio Melotti ezio.melo...@gmail.com added the comment:
With this approach is necessary to exclude the base class from the tests,
either by listing all the Python/C tests explicitly or doing some automatic
check to find these base classes. Listing all the tests is a bad idea because
it needs
Antoine Pitrou pit...@free.fr added the comment:
With this approach is necessary to exclude the base class from the
tests, either by listing all the Python/C tests explicitly or doing
some automatic check to find these base classes.
It just needs a small change then:
class PyTest(TestCase):
R. David Murray rdmur...@bitdance.com added the comment:
My usual pattern (adopted from examples in the stdlib tests) is this:
TestSomethingBase:
tests
PyTestSomething(TestSomethingBase, TestCase):
stuff
CTestSomething(TestSomethingBase, TestCase):
stuff
Is there a reason that
Ezio Melotti ezio.melo...@gmail.com added the comment:
Technically they both work, they are just two different approaches that offer
more or less the same compromise between features and verbosity.
Your approach requires an extra class for each test but saves you from setting
the module
Ezio Melotti ezio.melo...@gmail.com added the comment:
Attached patch uses the approach described in msg135881.
--
Added file: http://bugs.python.org/file21990/issue5723-2.diff
___
Python tracker rep...@bugs.python.org
Ezio Melotti ezio.melo...@gmail.com added the comment:
Attached patch refactors the tests to use import_fresh_module and different
subclasses for Python and C tests.
It also includes a fix to import_fresh_module to make it work with packages (it
can be committed separately).
--
Changes by Xuanji Li xua...@gmail.com:
--
nosy: +xuanji
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5723
___
___
Python-bugs-list mailing list
Bob Ippolito b...@redivi.com added the comment:
I did this some time ago in simplejson by defining a TestSuite subclass and
instrumenting simplejson so that speedups can be enabled and disabled easily
with a private API.
Ezio Melotti ezio.melo...@gmail.com added the comment:
Some tests for py_make_scanner have been added in c3ad883b940b.
I agree that having the tested method as an attribute of the class and changing
it on a different subclass is the best approach, but it's not currently done by
the json
Changes by joshua williams jowil...@gmail.com:
--
nosy: +jowillia
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5723
___
___
Python-bugs-list
Fred L. Drake, Jr. fdr...@acm.org added the comment:
This lack of tests is an issue for Python 2.6 as well.
Issue 9233 might have been avoided were the pure-Python implementation tested.
--
nosy: +fdrake
versions: +Python 2.6
___
Python tracker
Changes by Ezio Melotti ezio.melo...@gmail.com:
--
nosy: +ezio.melotti
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5723
___
___
Python-bugs-list
Antoine Pitrou pit...@free.fr added the comment:
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
Bob Ippolito b...@redivi.com added the comment:
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
New submission from Antoine Pitrou pit...@free.fr:
Looking at the tests it seems that the pure-Python paths of json are
partly untested. In particular, py_make_scanner (as oppose to
c_make_scanner).
--
assignee: bob.ippolito
components: Tests
messages: 85770
nosy: benjamin.peterson,
Bob Ippolito b...@redivi.com added the comment:
Is this high priority? The pure-Python code paths don't even run in
cpython. I test them manually with simplejson by just deleting the
extension and then running the tests again. There doesn't seem to be a
very good way to do this sort of thing
Antoine Pitrou pit...@free.fr added the comment:
Is this high priority? The pure-Python code paths don't even run in
cpython. I test them manually with simplejson by just deleting the
extension and then running the tests again. There doesn't seem to be a
very good way to do this sort of
Walter Dörwald wal...@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
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
It is a priority because we need solid test coverage in order to
successfully port 2.7 to 3.1 without breaking code or changing
semantics. The original 3.0 port was done badly.
--
nosy: +rhettinger
24 matches
Mail list logo