This adds a few preliminary tests for the message spec.
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:
History messages are not yet tested, but I think I get at least elementary coverage of everything else in the doc.
fix outdated payload part of messaging spec
begin testing message spec
correct keys in pyerr messages
add detail_level to object_info requests
as described in message spec
a couple more oinfo tests
use parametric tests in message_spec
Now each key check counts as a test
include execution_count in pyin check
more detail in oinfo tests
mark IOPub channel tests
Are you getting these tests run by a simple iptest? I think IPython.zmq is still in our exclusions list... If I run it manually via iptest IPython.zmq, I get dropped into an interactive editor a couple of times... It seems that the zmq subpackage has a couple of nasty tests in it and maybe initially we just punted and disabled the lot. As part of this PR, we should fix that so that iptest picks up all of IPython.zmq for testing as well...
No, I'd been running the individual test file manually (iptest IPython.zmq.tests.test_message_spec).
I'll get on fixing IPython.zmq for general testing.
Awesome. That way this PR will really have the (fantastic) impact of getting all of our zmq stuff into the regular testing workflow.
close KernelManager channel sockets when they stop
Otherwise there are dangling sockets on the Context, which cannot terminate.
skip magic_edit doctest in zmqshell
it opens a GUI editor, which is obviously inappropriate
include IPython.zmq in iptest groups
okay, iptest now runs IPython.zmq (with gtk/matplotlib exclusions, as appropriate, I believe).
Awesome! All tetsts pass on my box; we may get a few odd failures tomorrow from the buildbots, but if that's the case we'll track them one by one with the info from Shining Pandas. Heads-up to @takluyver in case anything out of the ordinary happens with py3. But let's merge this as-is, you did a terrific job and I'm thrilled to have zmq and messaging test coverage; we can fine-tune things later as needed.