Skip to content

Commit

Permalink
fix readme
Browse files Browse the repository at this point in the history
  • Loading branch information
devanshshukla99 authored Jun 23, 2021
1 parent e35fc0e commit 0aaff20
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,31 +24,34 @@ Usage
Pytest plugin
*************

The plugin works by using interceptors of different libraries which can be checked by `response.available()` method; these interceptors have to be applied for each pytest run using ``--remote={INTERCEPTOR}``.
The plugin works by using interceptors of different libraries which can be checked by ``response.available()`` method; these interceptors have to be applied for each pytest run using ``--remote={INTERCEPTOR}``.

.. code-block:: console
.. code-block:: bash
$ pytest --remote="urllib_quick|requests_quick|aiohttp_quick"
Handling requests:

- Prevent remote requests:
all requests are allowed by default; one can disable them using `--remote-blocked` flag.

.. code-block:: console
.. code-block:: bash
$ pytest --remote-blocked
$ pytest --remote={INTERCEPTORS} --remote-blocked
- Capture remote requests:
the requests can be captured in a ``json`` file using ``--remote-capture`` arg.

.. code-block:: console
.. code-block:: bash
$ pytest --remote={INTERCEPTORS} --remote-capture
- Mock remote requests:
the requests can be mocked using ``--remote-response`` flag.
NOTE: Due to certain limitations, it is advised to not use this plugin in an offline environment,

NOTE: Due to certain limitations, it is advised to not use this plugin in an offline environment.

.. code-block:: bash
.. code-block:: console
$ pytest --remote={INTERCEPTORS} --remote-response
Expand All @@ -60,6 +63,7 @@ The tools implemented in this package can be easily ported to any other applicat
Configuration:

.. code-block:: python
from pytest_response import response
response.setup_database({DUMP FILE})
Expand Down

0 comments on commit 0aaff20

Please sign in to comment.