1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 pythonOlder,
6 flaky,
7 ipykernel,
8 ipyparallel,
9 pre-commit,
10 pytestCheckHook,
11 pytest-asyncio,
12 pytest-timeout,
13}:
14
15buildPythonPackage {
16 pname = "ipykernel-tests";
17 inherit (ipykernel) version src;
18 format = "other";
19
20 dontBuild = true;
21 dontInstall = true;
22
23 nativeCheckInputs = [
24 flaky
25 ipykernel
26 ipyparallel
27 pre-commit
28 pytestCheckHook
29 pytest-asyncio
30 pytest-timeout
31 ];
32
33 preCheck = ''
34 export HOME=$(mktemp -d)
35 '';
36
37 disabledTests = [
38 # The following three tests fail for unclear reasons.
39 # pytest.PytestUnhandledThreadExceptionWarning: Exception in thread Thread-8
40 "test_asyncio_interrupt"
41
42 # DeprecationWarning: Passing unrecognized arguments to super(IPythonKernel)
43 "test_embed_kernel_func"
44
45 # traitlets.config.configurable.MultipleInstanceError: An incompatible siblin...
46 "test_install_kernelspec"
47 ]
48 ++ lib.optionals stdenv.hostPlatform.isDarwin (
49 [
50 # see https://github.com/NixOS/nixpkgs/issues/76197
51 "test_subprocess_print"
52 "test_subprocess_error"
53 "test_ipython_start_kernel_no_userns"
54
55 # https://github.com/ipython/ipykernel/issues/506
56 "test_unc_paths"
57 ]
58 ++ lib.optionals (pythonOlder "3.8") [
59 # flaky test https://github.com/ipython/ipykernel/issues/485
60 "test_shutdown"
61
62 # test regression https://github.com/ipython/ipykernel/issues/486
63 "test_sys_path_profile_dir"
64 "test_save_history"
65 "test_help_output"
66 "test_write_kernel_spec"
67 "test_ipython_start_kernel_userns"
68 "ZMQDisplayPublisherTests"
69 ]
70 );
71
72 # Some of the tests use localhost networking.
73 __darwinAllowLocalNetworking = true;
74}