[issue5723] Incomplete json tests

2011-05-13 Thread Roundup Robot
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:

[issue5723] Incomplete json tests

2011-05-13 Thread Ezio Melotti
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 ___

[issue5723] Incomplete json tests

2011-05-12 Thread Antoine Pitrou
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,

[issue5723] Incomplete json tests

2011-05-12 Thread Ezio Melotti
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,

[issue5723] Incomplete json tests

2011-05-12 Thread Antoine Pitrou
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.

[issue5723] Incomplete json tests

2011-05-12 Thread Ezio Melotti
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

[issue5723] Incomplete json tests

2011-05-12 Thread Antoine Pitrou
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):

[issue5723] Incomplete json tests

2011-05-12 Thread R. David Murray
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

[issue5723] Incomplete json tests

2011-05-12 Thread Ezio Melotti
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

[issue5723] Incomplete json tests

2011-05-12 Thread Ezio Melotti
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

[issue5723] Incomplete json tests

2011-05-11 Thread Ezio Melotti
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). --

[issue5723] Incomplete json tests

2011-04-26 Thread Xuanji Li
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

[issue5723] Incomplete json tests

2011-04-17 Thread Bob Ippolito
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.

[issue5723] Incomplete json tests

2011-04-13 Thread Ezio Melotti
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

[issue5723] Incomplete json tests

2010-08-04 Thread joshua williams
Changes by joshua williams jowil...@gmail.com: -- nosy: +jowillia ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5723 ___ ___ Python-bugs-list

[issue5723] Incomplete json tests

2010-07-12 Thread Fred L. Drake, Jr.
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

[issue5723] Incomplete json tests

2010-07-12 Thread Ezio Melotti
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

[issue5723] Incomplete json tests

2009-04-11 Thread Antoine Pitrou
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

[issue5723] Incomplete json tests

2009-04-09 Thread Bob Ippolito
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

[issue5723] Incomplete json tests

2009-04-08 Thread Antoine Pitrou
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,

[issue5723] Incomplete json tests

2009-04-08 Thread Bob Ippolito
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

[issue5723] Incomplete json tests

2009-04-08 Thread Antoine Pitrou
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

[issue5723] Incomplete json tests

2009-04-08 Thread Walter Dörwald
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

[issue5723] Incomplete json tests

2009-04-08 Thread Raymond Hettinger
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