Should depend on ipykernel
juliangilbey opened this issue · 0 comments
It turns out that unittest's behaviour for subclasses is interesting: it appears to call the setUpClass method for both the subclass and the superclass. So when subclassing KernelTests for testing a kernel, and setting kernel_name
as a class variable in the subclass, the setUpClass method in KernelTests is called both for this subclass with its specified kernel_name
but also for jupyter_kernel_test.KernelTests
itself, with kernel_name == "python3"
. This therefore requires ipykernel
to be installed, otherwise the test fails with an error (python3 kernel not found).
The simplest solution appears to be to depend on ipykernel, so that the python3 kernel is guaranteed to be present when using this package.