From 40a58cc65bec0ed5b784178239e55f7c7ac969f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Mon, 21 Sep 2020 20:08:22 +0200 Subject: [PATCH] python3.pkgs.yq: make stdin a tty for tests --- pkgs/development/python-modules/yq/default.nix | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pkgs/development/python-modules/yq/default.nix b/pkgs/development/python-modules/yq/default.nix index ee768eaab756..f795a8fdfad6 100644 --- a/pkgs/development/python-modules/yq/default.nix +++ b/pkgs/development/python-modules/yq/default.nix @@ -10,6 +10,7 @@ , flake8 , jq , pytest +, unixtools , toml }: @@ -22,10 +23,6 @@ buildPythonPackage rec { sha256 = "1gp9q5w1bjbw7wmba5hm8ippwvkind0p02n07fqa9jlqglhxhm46"; }; - postPatch = '' - substituteInPlace test/test.py --replace "expect_exit_codes={0} if sys.stdin.isatty() else {2}" "expect_exit_codes={0}" - ''; - propagatedBuildInputs = [ pyyaml xmltodict @@ -35,6 +32,7 @@ buildPythonPackage rec { doCheck = true; checkInputs = [ + unixtools.script pytest coverage flake8 @@ -42,7 +40,8 @@ buildPythonPackage rec { toml ]; - checkPhase = "pytest ./test/test.py"; + # tests fails if stdin is not a tty + checkPhase = "echo | script -c 'pytest ./test/test.py'"; pythonImportsCheck = [ "yq" ];