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

View file

@ -28,6 +28,7 @@
# Check Inputs
, ddt
, pytestCheckHook
, pytest-timeout
, qiskit-aer
}:
@ -100,6 +101,7 @@ buildPythonPackage rec {
checkInputs = [
pytestCheckHook
ddt
pytest-timeout
qiskit-aer
];
pythonImportsCheck = [
@ -110,7 +112,10 @@ buildPythonPackage rec {
"qiskit.ml"
"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_vqe.py"
"--ignore=test/chemistry/test_vqe_uccsd_adapt.py"