File: pytest_options.patch

package info (click to toggle)
qutip 5.2.1-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,868 kB
  • sloc: python: 44,578; cpp: 456; makefile: 175; sh: 16
file content (34 lines) | stat: -rw-r--r-- 1,167 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Index: qutip/qutip/testing.py
===================================================================
--- qutip.orig/qutip/testing.py	2024-07-06 11:11:01.699289744 +0200
+++ qutip/qutip/testing.py	2024-07-06 11:11:01.695289769 +0200
@@ -1,7 +1,7 @@
 from .about import about
 from .settings import settings as qset
 
-def run(full=False):
+def run(full=False, pytest_options=[]):
     """
     Run the test scripts for QuTiP.
 
@@ -10,6 +10,11 @@
     full: bool
         If True run all test (30 min). Otherwise skip few variants of the
         slowest tests.
+
+    pytest_options: list
+        List of extra command-line options to provide to pytest,
+        each provided as [option[,value]] items
+        e.g. pytest_options=[["--verbose"],["-k","not test_qubit"]]
     """
     # Call about to get all version info printed with tests
     about()
@@ -25,6 +30,8 @@
     test_options = ["--verbosity=1", "--disable-pytest-warnings", "--pyargs"]
     if not full:
         test_options += ['-m', 'not slow']
+    for pyopt in pytest_options:
+        test_options += pyopt
     pytest.main(test_options + ["qutip"])
     # runs tests in qutip.tests module only