Missing Modules #201

Open
pyjsorg opened this Issue Apr 27, 2012 · 7 comments

Projects

None yet

1 participant

Contributor
pyjsorg commented Apr 27, 2012

There is some missing modules inside pyjamas:

StringIO
getopt
unittest
urlparse

Here is their pyjamas-port and test.
(the port was done from Pypy sources which have an MIT Licence)
I've tested them on python 2.6.4 and firefox/ubuntu (both -O and --strict)

On the unittest module, not the whole module has been ported. (def main is decoy and class TestLoader is missing most advanced reflection stuffs)

Stolati

Original issue: http://code.google.com/p/pyjamas/issues/detail?id=518 (November 18, 2010 21:39:23)

Contributor
pyjsorg commented Apr 27, 2012

From cornelis...@gmail.com on November 20, 2010 11:06:06:
It's not clear to me what you aim to do with unittest.py It has lots of resemblance with pyjamas' libtest/UnitTest.py. Should it be an replacement for that?

If I add the following code to test_unittest.py:
{{{


if name == 'main':
import test_unittest as test_module
for key in dir(test_module):
test = getattr(test_module, key)
try:
issubclass(test, unittest.TestCase)
except:
test = None
if test is not None:
suite = unittest.TestLoader().loadTestsFromTestCase(test)
unittest.TextTestRunner(verbosity=2).run(suite)
}}}
I see lots of errors when I run this with cPython (2.5).

Contributor
pyjsorg commented Apr 27, 2012

From luke.lei...@gmail.com on November 20, 2010 16:54:32:
thank you mickael. kees, let me add these anyway. mickael, would you kindly be able to morph the unit tests into libtest so that they can fit into the pyjs compiler testing? tia

Contributor
pyjsorg commented Apr 27, 2012

From luke.lei...@gmail.com on November 20, 2010 16:55:35:
also for future reference, diff -u patches are far easier - one file, not 10.
if you use git, it's just "git diff".

Contributor
pyjsorg commented Apr 27, 2012

From luke.lei...@gmail.com on November 20, 2010 17:01:01:
also: it's necessary to know who the copyright is, exactly: what date, and whom to credit. could you kindly track that down?

i presently have, in the copyright file:

Files: pyjs/src/pyjs/lib/StringIO.py pyjs/src/pyjs/lib/getopt.py pyjs/src/pyjs/lib/urlparse.py
Copyright: PyPy
License: MIT

that's not enough: i need to know one line which includes the date of all modifications of that code, and whom to credit.

l.

Contributor
pyjsorg commented Apr 27, 2012

From mickael....@gmail.com on November 22, 2010 14:45:50:
cornelis ->
It's libtest/UniTest that's like the standard python module unittest. (since 2.1)
Thanks for the python2.5 comment, i'm working on it.

luke ->
It seems I've only done half the work :)

Contributor
pyjsorg commented Apr 27, 2012

From wkornew...@gmail.com on November 29, 2010 11:13:17:
FYI, on the pyjs discussion group I've started a little thread about getting the unittest module to work. I'd like to extend pyjs to the point where it can run unittest unmodified. That's better than having to port every single module by hand.

Also, I've already implemented the traceback module and fixed sys.exc_info(), so they work with unittest. There's no need to have workarounds for those, anymore.

Contributor
pyjsorg commented Apr 27, 2012

From wkornew...@gmail.com on November 29, 2010 11:14:50:
Almost forgot to ask: Do you want to help with getting pyjs more Python-compliant, so we can run most modules unmodified? We could start with unittest since it's a really important module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment