Skip to content

Commit

Permalink
docs: contributing: Correct REQUIRED_PLUGINS docs
Browse files Browse the repository at this point in the history
Signed-off-by: John Andersen <johnandersenpdx@gmail.com>
  • Loading branch information
pdxjohnny committed Jun 22, 2021
1 parent aef2eb8 commit 383d5b1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/contributing/style.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Here's an example of how we style our imports.
from dffml.record import Record
from dffml.configloader.configloader import BaseConfigLoader
from dffml.util.asynctestcase import AsyncTestCase, IntegrationCLITestCase
from dffml.util.asynctestcase import AsyncTestCase
import dffml_model_scikit
Expand Down
12 changes: 10 additions & 2 deletions docs/contributing/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ You can also run all tests which have a given string in their name.
Writing Tests
-------------

If your test is within the main package, aka ``tests/``, and you need to use a
plugin within your test, you should subclass from ``IntegrationCLITestCase``.
If your test is within the main package, aka ``tests/`` you should subclass from
``AsyncTestCase``.

For example if you need test something where you had to load a PNG, you'd do

Expand All @@ -36,6 +36,14 @@ For example if you need test something where you had to load a PNG, you'd do
async def test_something_with_a_png(self):
self.required_plugins("dffml-config-png")
If all methods within a class require a plugin or set of plugins, those plugin
names can be listed in the ``REQUIRED_PLUGINS`` class variable.

.. code-block:: python
class MyTest(AsyncTestCase):
REQUIRED_PLUGINS = ["dffml-config-png"]
.. _running_ci_tests_locally:

Running CI Tests Locally
Expand Down

0 comments on commit 383d5b1

Please sign in to comment.