Merge pull request #1627 from minrk/msgspec

Test the Message Spec and add our zmq subpackage to the test suite.

It uses Traitlets to perform validation of keys.

Checks right now are not very strict, as (almost) any key is allowed to be None, as long as it is defined.  This is because I simply do not know which keys are allowed to be None, and this is not discussed in the specification.  If no keys are allowed to be None, we violate that all over the place.

Parametric tests are used, so every key validation counts as a test (147!).

Message spec doc was found to misrepresent code in a few points, and some changes were made:

* spec had error keys as `exc_name/value`, but we are actually using `ename/value` (docs updated to match code)
* payloads were inaccurate - list of dicts, rather than single dict, and transformed_output is a payload, not top-level in exec-reply (docs update to match code).
* in oinfo_request, detail_level was in message spec, but not actually implemented (code updated to match docs).

History messages are not yet tested, but I think I get at least elementary coverage of everything else in the doc.
This commit is contained in:
Fernando Perez 2012-04-18 15:40:47 -07:00
commit 53ccdfbd44

View File

@ -233,6 +233,7 @@ def make_exclude():
# We do this unconditionally, so that the test suite doesn't import
# gtk, changing the default encoding and masking some unicode bugs.
exclusions.append(ipjoin('lib', 'inputhookgtk'))
exclusions.append(ipjoin('zmq', 'gui', 'gtkembed'))
# These have to be skipped on win32 because the use echo, rm, cd, etc.
# See ticket https://github.com/ipython/ipython/issues/87
@ -263,7 +264,9 @@ def make_exclude():
if not have['matplotlib']:
exclusions.extend([ipjoin('core', 'pylabtools'),
ipjoin('core', 'tests', 'test_pylabtools')])
ipjoin('core', 'tests', 'test_pylabtools'),
ipjoin('zmq', 'pylab'),
])
if not have['tornado']:
exclusions.append(ipjoin('frontend', 'html'))
@ -385,6 +388,7 @@ def make_runners():
'scripts', 'testing', 'utils', 'nbformat' ]
if have['zmq']:
nose_pkg_names.append('zmq')
nose_pkg_names.append('parallel')
# For debugging this code, only load quick stuff