Loading pkgs/development/python-modules/nbmerge/default.nix +5 −8 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ fetchFromGitHub, setuptools, nbformat, nose, pytestCheckHook, }: buildPythonPackage rec { Loading @@ -19,20 +19,17 @@ buildPythonPackage rec { hash = "sha256-Uqs/SO/AculHCFYcbjW08kLQX5GSU/eAwkN2iy/vhLM="; }; patches = [ ./pytest-compatibility.patch ]; nativeBuildInputs = [ setuptools ]; propagatedBuildInputs = [ nbformat ]; nativeCheckInputs = [ nose ]; checkPhase = '' runHook preCheck nativeCheckInputs = [ pytestCheckHook ]; postCheck = '' patchShebangs . nosetests -v PATH=$PATH:$out/bin ./cli_tests.sh runHook postCheck ''; pythonImportsCheck = [ "nbmerge" ]; Loading pkgs/development/python-modules/nbmerge/pytest-compatibility.patch 0 → 100644 +19 −0 Original line number Diff line number Diff line diff --git a/tests/test_merge.py b/tests/test_merge.py index 06ee559..9d7b1af 100644 --- a/tests/test_merge.py +++ b/tests/test_merge.py @@ -1,3 +1,4 @@ +import io import os import sys import unittest @@ -21,8 +22,7 @@ def file_names_from(file_paths): class TestMerge(unittest.TestCase): def setUp(self): - if not hasattr(sys.stdout, "getvalue"): - self.fail("need to run in buffered mode") + sys.stdout = io.StringIO() def _validate_merged_three(self, merged): self.assertEqual(len(merged.cells), 6) Loading
pkgs/development/python-modules/nbmerge/default.nix +5 −8 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ fetchFromGitHub, setuptools, nbformat, nose, pytestCheckHook, }: buildPythonPackage rec { Loading @@ -19,20 +19,17 @@ buildPythonPackage rec { hash = "sha256-Uqs/SO/AculHCFYcbjW08kLQX5GSU/eAwkN2iy/vhLM="; }; patches = [ ./pytest-compatibility.patch ]; nativeBuildInputs = [ setuptools ]; propagatedBuildInputs = [ nbformat ]; nativeCheckInputs = [ nose ]; checkPhase = '' runHook preCheck nativeCheckInputs = [ pytestCheckHook ]; postCheck = '' patchShebangs . nosetests -v PATH=$PATH:$out/bin ./cli_tests.sh runHook postCheck ''; pythonImportsCheck = [ "nbmerge" ]; Loading
pkgs/development/python-modules/nbmerge/pytest-compatibility.patch 0 → 100644 +19 −0 Original line number Diff line number Diff line diff --git a/tests/test_merge.py b/tests/test_merge.py index 06ee559..9d7b1af 100644 --- a/tests/test_merge.py +++ b/tests/test_merge.py @@ -1,3 +1,4 @@ +import io import os import sys import unittest @@ -21,8 +22,7 @@ def file_names_from(file_paths): class TestMerge(unittest.TestCase): def setUp(self): - if not hasattr(sys.stdout, "getvalue"): - self.fail("need to run in buffered mode") + sys.stdout = io.StringIO() def _validate_merged_three(self, merged): self.assertEqual(len(merged.cells), 6)