py2js and python-testutil

2 views
Skip to first unread message

Jonathan Fine

unread,
Apr 30, 2010, 2:03:32 AM4/30/10
to JavaScript for Python programmers
Hello

Suppose we want to test an 'add' function, which we will call 'f'.  How about writing:
  f(2, 2) == 4

What could be simpler than that.  And for exceptions:
  f(2, "a string") ** ValueError
where we use '**' to mean 'raises'.

This is the basic philosophy of python-testutil: http://bitbucket.org/jfine/python-testutil/

Notice that in the above I did not specify the programming language.  In other words, the test I wrote is language independent and can be used with multiple languages, such as JavaScript and Python.

For this reason, I'm suggesting that py2js think about using python-testutil (which isn't quite ready for use just now).

--
Jonathan

--
You received this message because you are subscribed to the Google Groups "JavaScript for Python programmers" group.
To post to this group, send an email to js...@googlegroups.com.
To unsubscribe from this group, send email to js4py+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/js4py?hl=en-GB.
Reply all
Reply to author
Forward
0 new messages