summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/ipykernel/tests.nix
blob: 3e4191104769f44b83ad2579c54d677fef2eea9d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
{
  lib,
  stdenv,
  buildPythonPackage,
  flaky,
  ipykernel,
  ipyparallel,
  pre-commit,
  pytestCheckHook,
  pytest-asyncio,
  pytest-timeout,
}:

buildPythonPackage {
  pname = "ipykernel-tests";
  inherit (ipykernel) version src;
  pyproject = false;

  dontBuild = true;
  dontInstall = true;

  nativeCheckInputs = [
    flaky
    ipykernel
    ipyparallel
    pre-commit
    pytestCheckHook
    pytest-asyncio
    pytest-timeout
  ];

  preCheck = ''
    export HOME=$(mktemp -d)
  '';

  disabledTests = [
    # The following three tests fail for unclear reasons.
    # pytest.PytestUnhandledThreadExceptionWarning: Exception in thread Thread-8
    "test_asyncio_interrupt"

    # DeprecationWarning: Passing unrecognized arguments to super(IPythonKernel)
    "test_embed_kernel_func"

    # traitlets.config.configurable.MultipleInstanceError: An incompatible siblin...
    "test_install_kernelspec"
  ]
  ++ lib.optionals stdenv.hostPlatform.isDarwin [
    # see https://github.com/NixOS/nixpkgs/issues/76197
    "test_subprocess_print"
    "test_subprocess_error"
    "test_ipython_start_kernel_no_userns"

    # https://github.com/ipython/ipykernel/issues/506
    "test_unc_paths"
  ];

  # Some of the tests use localhost networking.
  __darwinAllowLocalNetworking = true;
}