testing: timeout long tests

https://github.com/NixOS/nixpkgs/issues/102724
This commit is contained in:
Drew Risinger 2020-11-04 13:03:00 -05:00 committed by Jonathan Ringer
parent f13c73c093
commit 0e7d871210
2 changed files with 12 additions and 1 deletions

View file

@ -21,6 +21,7 @@
, pytestCheckHook , pytestCheckHook
, ddt , ddt
, fixtures , fixtures
, pytest-timeout
, qiskit-terra , qiskit-terra
}: }:
@ -81,8 +82,13 @@ buildPythonPackage rec {
pytestCheckHook pytestCheckHook
ddt ddt
fixtures fixtures
pytest-timeout
qiskit-terra qiskit-terra
]; ];
pytestFlagsArray = [
"--timeout=30"
"--durations=10"
];
preCheck = '' preCheck = ''
# Tests include a compiled "circuit" which is auto-built in $HOME # Tests include a compiled "circuit" which is auto-built in $HOME

View file

@ -28,6 +28,7 @@
# Check Inputs # Check Inputs
, ddt , ddt
, pytestCheckHook , pytestCheckHook
, pytest-timeout
, qiskit-aer , qiskit-aer
}: }:
@ -100,6 +101,7 @@ buildPythonPackage rec {
checkInputs = [ checkInputs = [
pytestCheckHook pytestCheckHook
ddt ddt
pytest-timeout
qiskit-aer qiskit-aer
]; ];
pythonImportsCheck = [ pythonImportsCheck = [
@ -110,7 +112,10 @@ buildPythonPackage rec {
"qiskit.ml" "qiskit.ml"
"qiskit.optimization" "qiskit.optimization"
]; ];
pytestFlagsArray = lib.optionals (!withPyscf) [ pytestFlagsArray = [
"--timeout=30"
"--durations=10"
] ++ lib.optionals (!withPyscf) [
"--ignore=test/chemistry/test_qeom_ee.py" "--ignore=test/chemistry/test_qeom_ee.py"
"--ignore=test/chemistry/test_qeom_vqe.py" "--ignore=test/chemistry/test_qeom_vqe.py"
"--ignore=test/chemistry/test_vqe_uccsd_adapt.py" "--ignore=test/chemistry/test_vqe_uccsd_adapt.py"