File tree 1 file changed +20
-1
lines changed
1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,8 @@ in the current directory and its subdirectories. More generally, pytest follows
17
17
Specifying which tests to run
18
18
------------------------------
19
19
20
- Pytest supports several ways to run and select tests from the command-line.
20
+ Pytest supports several ways to run and select tests from the command-line or from a file
21
+ (see below for :ref: `reading arguments from file <args-from-file >`).
21
22
22
23
**Run tests in a module **
23
24
@@ -91,6 +92,24 @@ For more information see :ref:`marks <mark>`.
91
92
92
93
This will import ``pkg.testing `` and use its filesystem location to find and run tests from.
93
94
95
+ .. _args-from-file :
96
+
97
+ **Read arguments from file **
98
+
99
+ All of the above can be read from a file using the `@ ` prefix
100
+
101
+ .. code-block :: bash
102
+
103
+ pytest @tests_to_run.txt
104
+
105
+ where ``tests_to_run.txt `` contains an entry per line, e.g.
106
+
107
+ .. code-block :: text
108
+
109
+ tests/test_file.py
110
+ tests/test_mod.py::test_func[x1,y2]
111
+ tests/test_mod.py::TestClass
112
+ -m slow
94
113
95
114
Getting help on version, option names, environment variables
96
115
--------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments