Skip to content

Commit 0090bf4

Browse files
jmmaloney4JohnRTitor
authored andcommitted
nbstripout: fix tests
1 parent b4cef5f commit 0090bf4

File tree

1 file changed

+15
-6
lines changed
  • pkgs/applications/version-management/nbstripout

1 file changed

+15
-6
lines changed

pkgs/applications/version-management/nbstripout/default.nix

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
lib,
33
python3,
44
fetchPypi,
5+
fetchFromGitHub,
56
coreutils,
67
gitMinimal,
78
mercurial,
@@ -16,11 +17,12 @@ python3.pkgs.buildPythonApplication rec {
1617
hash = "sha256-6qyLa05yno3+Hl3ywPi6RKvFoXplRI8EgBQfgL4jC7E=";
1718
};
1819

19-
# for some reason, darwin uses /bin/sh echo native instead of echo binary, so
20-
# force using the echo binary
21-
postPatch = ''
22-
substituteInPlace tests/test-git.t --replace "echo" "${coreutils}/bin/echo"
23-
'';
20+
testAssets = fetchFromGitHub {
21+
owner = "kynan";
22+
repo = "nbstripout";
23+
rev = "${version}";
24+
hash = "sha256-OSJLrWkYQIhcdyofS3Bo39ppsU6K3A4546UKB8Q1GGg=";
25+
};
2426

2527
propagatedBuildInputs = with python3.pkgs; [
2628
nbformat
@@ -33,14 +35,21 @@ python3.pkgs.buildPythonApplication rec {
3335
mercurial
3436
]
3537
++ (with python3.pkgs; [
36-
pytest-cram
3738
pytestCheckHook
3839
]);
3940

41+
checkInputs = [
42+
testAssets
43+
];
44+
4045
preCheck = ''
4146
export HOME=$(mktemp -d)
4247
export PATH=$out/bin:$PATH
4348
git config --global init.defaultBranch main
49+
50+
cp -r --no-preserve=mode,ownership ${testAssets}/tests/e2e_notebooks $TMPDIR/e2e_notebooks
51+
chmod -R +w $TMPDIR/e2e_notebooks
52+
substituteInPlace tests/test_end_to_end.py --replace "tests/e2e_notebooks" "$TMPDIR/e2e_notebooks"
4453
'';
4554

4655
meta = {

0 commit comments

Comments
 (0)