Skip to content

Commit b1b0dfa

Browse files
committed
Add some rudimentary docs for runner input files handling
This gets the basics in a very simplistic fashion. What's missing is any indication of the availability of this feature in the argparse created help (the output one sees from gabbi-run --help). It's not clear what the best way to add this is, since the feature is being managed outside argparse.
1 parent 6136025 commit b1b0dfa

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

docs/source/runner.rst

+12-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ If there is a running web service that needs to be tested and
55
creating a test loader with :meth:`~gabbi.driver.build_tests` is
66
either inconvenient or overkill it is possible to run YAML test
77
files directly from the command line with the console-script
8-
``gabbi-run``. It accepts YAML on ``stdin``, generates and runs
9-
tests and outputs a summary of the results.
8+
``gabbi-run``. It accepts YAML on ``stdin`` or as multiple file
9+
arguments, and generates and runs tests and outputs a summary of
10+
the results.
1011

1112
The provided YAML may not use custom :doc:`fixtures` but otherwise
1213
uses the default :doc:`format`. :doc:`host` information is either
@@ -19,6 +20,15 @@ or::
1920

2021
gabbi-run http://host:port < /my/test.yaml
2122

23+
To test with one or more files the following command syntax may be
24+
used::
25+
26+
gabbi-run http://host:port -- /my/test.yaml /my/other.yaml
27+
28+
.. note:: The filename arguments must come after a ``--`` and all
29+
other arguments (host, port, prefix, failfast) must come
30+
before the ``--``.
31+
2232
To facilitate using the same tests against the same application mounted
2333
in different locations in a WSGI server, a ``prefix`` may be provided
2434
as a second argument::

gabbi/runner.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,15 @@ def run():
5353
5454
gabbi-run http://example.com:9999/mountpoint < mytest.yaml
5555
56-
Use `-x` or `--failfast` to abort after the first error or failure:
56+
Use `-x` or `--failfast` to abort after the first error or failure::
5757
5858
gabbi-run -x example.com:9999 /mountpoint < mytest.yaml
5959
60+
Multiple files may be named as arguments, separated from other arguments
61+
by a ``--``. Each file will be run as a separate test suite::
62+
63+
gabbi-run http://example.com -- /path/to/x.yaml /path/to/y.yaml
64+
6065
Output is formatted as unittest summary information.
6166
"""
6267
parser = _make_argparser()

0 commit comments

Comments
 (0)