Skip to content

Commit

Permalink
Document entrypoint (#215)
Browse files Browse the repository at this point in the history
Missed in #187.
  • Loading branch information
adamchainz committed Nov 18, 2019
1 parent 32654bc commit 3cd883d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,21 @@ altogether, you can use the ``-p`` argument, for example:
.. code-block:: sh
pytest -p no:randomly
Entry Point
-----------

If you're using a different randomness generator in your third party package,
you can register an entrypoint to be called every time ``pytest-randomly``
reseeds. Implement the entrypoint ``pytest_randomly.random_seeder``, referring
to a function/callable that takes one argument, the new seed (int).

For example in your ``setup.cfg``:

.. code-block:: sh
[options.entry_points]
pytest_randomly.random_seeder =
mypackage = mypackage.reseed
Then implement ``reseed(new_seed)``.

0 comments on commit 3cd883d

Please sign in to comment.