Skip to content

Commit 5a98980

Browse files
committed
Update doc/how-to/usage.rst
1 parent a413282 commit 5a98980

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

doc/en/how-to/usage.rst

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ in the current directory and its subdirectories. More generally, pytest follows
1717
Specifying which tests to run
1818
------------------------------
1919

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>`).
2122

2223
**Run tests in a module**
2324

@@ -91,6 +92,24 @@ For more information see :ref:`marks <mark>`.
9192
9293
This will import ``pkg.testing`` and use its filesystem location to find and run tests from.
9394

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
94113
95114
Getting help on version, option names, environment variables
96115
--------------------------------------------------------------

0 commit comments

Comments
 (0)