Skip to content

Add test framework

Thomas Kluyver requested to merge tests into main

CalParrot is now kind of important, but so far it hasn't had automated tests, as it's kind of inconvenient to write tests. This adds the machinery to make it possible to test:

  • Run an 'upstream' test server in a thread in the test process
    • Responses have a serial number, so we can tell if they're replayed
  • Launch CalParrot in a subprocess, telling it to use the test server
  • The child process inside CalParrot (where the notebook would normally run) writes the CalParrot proxy address to a file and waits
  • The pytest fixtures pick up the proxy address for the tests to use, and cleanly (🤞) shuts everything down afterwards
  • Helper functions to check for entries in the DB

cc @schmidtp

Merge request reports