You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 specifiedkernel_name
but also forjupyter_kernel_test.KernelTests
itself, withkernel_name == "python3"
. This therefore requiresipykernel
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.
The text was updated successfully, but these errors were encountered: