Skip to content
Browse files

Keeped only the basic example for writing a pytest class

  • Loading branch information...
Hugo QUEZADA committed Nov 1, 2019
1 parent 3187771 commit f925c0cd646bda7fb7f480d3f6611f85b14766e2
Showing with 5 additions and 9 deletions.
  1. +5 −9 doc/basic_usage.rst
@@ -763,21 +763,15 @@ To address these challenges, AnyBlok ships with helper pytest fixture
Writing tests with pytest

.. note:: See: `Pytest documentation <>`_

To start correctly you will need a ```` file.
Generally, you just want to import the conftest from the bloks you need
in your context, for example in our case::

from anyblok.conftest import * # noqa: F401,F403

But you can do more for example if you need a registry with one blok loaded only, we need a new fixture::

def registry_with_blok_to_load(request, testbloks_loaded):
registry = init_registry_with_bloks(['blok_to_load'], None)
return registry

Here you have an example to write a test class::
Here you have an example to write a basic test class::

class TestRoom:
"""Test Room model"""
@@ -792,6 +786,8 @@ Here you have an example to write a test class::
assert registry.Room.query().count() == room_count + 1
assert == "A1"

.. note:: For advanced examples, you can refer to our `developer guide <>`_

Launching tests with the pytest plugin

0 comments on commit f925c0c

Please sign in to comment.
You can’t perform that action at this time.