python3.pkgs.yq: make stdin a tty for tests
This commit is contained in:
parent
1a44ef9066
commit
40a58cc65b
1 changed files with 4 additions and 5 deletions
|
@ -10,6 +10,7 @@
|
||||||
, flake8
|
, flake8
|
||||||
, jq
|
, jq
|
||||||
, pytest
|
, pytest
|
||||||
|
, unixtools
|
||||||
, toml
|
, toml
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
@ -22,10 +23,6 @@ buildPythonPackage rec {
|
||||||
sha256 = "1gp9q5w1bjbw7wmba5hm8ippwvkind0p02n07fqa9jlqglhxhm46";
|
sha256 = "1gp9q5w1bjbw7wmba5hm8ippwvkind0p02n07fqa9jlqglhxhm46";
|
||||||
};
|
};
|
||||||
|
|
||||||
postPatch = ''
|
|
||||||
substituteInPlace test/test.py --replace "expect_exit_codes={0} if sys.stdin.isatty() else {2}" "expect_exit_codes={0}"
|
|
||||||
'';
|
|
||||||
|
|
||||||
propagatedBuildInputs = [
|
propagatedBuildInputs = [
|
||||||
pyyaml
|
pyyaml
|
||||||
xmltodict
|
xmltodict
|
||||||
|
@ -35,6 +32,7 @@ buildPythonPackage rec {
|
||||||
doCheck = true;
|
doCheck = true;
|
||||||
|
|
||||||
checkInputs = [
|
checkInputs = [
|
||||||
|
unixtools.script
|
||||||
pytest
|
pytest
|
||||||
coverage
|
coverage
|
||||||
flake8
|
flake8
|
||||||
|
@ -42,7 +40,8 @@ buildPythonPackage rec {
|
||||||
toml
|
toml
|
||||||
];
|
];
|
||||||
|
|
||||||
checkPhase = "pytest ./test/test.py";
|
# tests fails if stdin is not a tty
|
||||||
|
checkPhase = "echo | script -c 'pytest ./test/test.py'";
|
||||||
|
|
||||||
pythonImportsCheck = [ "yq" ];
|
pythonImportsCheck = [ "yq" ];
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue