Skip to content

Commit

Permalink
Docs: Fix example of the entry_points fixture (#6412)
Browse files Browse the repository at this point in the history
  • Loading branch information
sphuber authored May 23, 2024
1 parent 22ea063 commit 081fc55
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions docs/source/topics/plugins.rst
Original file line number Diff line number Diff line change
Expand Up @@ -786,17 +786,18 @@ Return a :class:`~aiida.manage.tests.pytest_fixtures.EntryPointManager` instance

.. code-block:: python
from aiida.parsers import Parser
class CustomParser(Parser):
"""Parser implementation."""
def test_parser(entry_points):
"""Test a custom ``Parser`` implementation."""
from aiida.parsers import Parser
from aiida.plugins import ParserFactory
class CustomParser(Parser):
"""Parser implementation."""
entry_points.add(CustomParser, 'aiida.parsers:custom.parser')
assert ParserFactory('custom.parser', CustomParser)
assert ParserFactory('custom.parser') is CustomParser
Any entry points additions and removals are automatically undone at the end of the test.

Expand Down

0 comments on commit 081fc55

Please sign in to comment.