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 [
39 # The following three tests fail for unclear reasons.
40 # pytest.PytestUnhandledThreadExceptionWarning: Exception in thread Thread-8
41 "test_asyncio_interrupt"
42
43 # DeprecationWarning: Passing unrecognized arguments to super(IPythonKernel)
44 "test_embed_kernel_func"
45
46 # traitlets.config.configurable.MultipleInstanceError: An incompatible siblin...
47 "test_install_kernelspec"
48 ]
49 ++ lib.optionals stdenv.hostPlatform.isDarwin (
50 [
51 # see https://github.com/NixOS/nixpkgs/issues/76197
52 "test_subprocess_print"
53 "test_subprocess_error"
54 "test_ipython_start_kernel_no_userns"
55
56 # https://github.com/ipython/ipykernel/issues/506
57 "test_unc_paths"
58 ]
59 ++ lib.optionals (pythonOlder "3.8") [
60 # flaky test https://github.com/ipython/ipykernel/issues/485
61 "test_shutdown"
62
63 # test regression https://github.com/ipython/ipykernel/issues/486
64 "test_sys_path_profile_dir"
65 "test_save_history"
66 "test_help_output"
67 "test_write_kernel_spec"
68 "test_ipython_start_kernel_userns"
69 "ZMQDisplayPublisherTests"
70 ]
71 );
72
73 # Some of the tests use localhost networking.
74 __darwinAllowLocalNetworking = true;
75}