sgzwiz / brython

Automatically exported from code.google.com/p/brython
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

no testing tool #69

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
How do I write unit tests for brython code?  It doesn't appear that any 
existing Python-based tool would work, and there's not much documentation for 
the JavaScript part of the API so it's not clear how a JavaScript-based testing 
tool would work either.  Given that Brython has quite a few differences from 
"real" python (CPython, Jython, PyPy) it's important to have a way to verify 
that the code does the same thing in the browser environment as in the 
easier-to-test command-line environment.

Can Brython be run under node.js?  What about its DOM stuff?

Original issue reported on code.google.com by Glyph.Lefkowitz on 13 Feb 2013 at 1:21

GoogleCodeExporter commented 9 years ago
As new code is being released, I'm trying to get the regular unittest module to 
work with brython.  Currently things get stuck on the from import statements 
since brython does not support this feature yet.  I'll post updates on my 
progress as new features are added to brython.

Original comment by billy.earney@gmail.com on 17 Feb 2013 at 12:04

GoogleCodeExporter commented 9 years ago
Currently I test a set of features using a specific page /tests/index.html (for 
instance on the Brython site at http://brython.info/tests/index.html). Test 
scripts are loaded from the buttons such as "test_suite.py", then run and I 
check that all tests pass
For instance I made a test script with all the issues on the tracker that are 
fixed at release date
Developers can edit the page and add other test scripts
I began working on the test scripts provided in the Python standard 
distribution and adapt them to the Brython environment, but it's a huge work...

Original comment by pierre.q...@gmail.com on 17 Feb 2013 at 8:56

GoogleCodeExporter commented 9 years ago
I am working on a testing tool.
A list of tests statements are manually defined.
The tool automatically compares Python3 output and Brython output.
It is already functionnal but I'd like to refine it a little bit before release.

Original comment by d...@famillepinault.fr on 22 Feb 2013 at 8:09

GoogleCodeExporter commented 9 years ago
I keep making progress of using python's unittest module in brython.  Issue 88 
implements relative imports (which is used by unittest).  I'm currently stuck 
on decorators, brython currently doesn't support them, so for the time being we 
probably should continue using the assert function Pierre has created or 
Nicolas' solution when it is ready.

Original comment by billy.earney@gmail.com on 27 Feb 2013 at 2:06