Skip to content

Commit

Permalink
test: refactor fixtures to load them automatically (#20)
Browse files Browse the repository at this point in the history
Need to set the current working directory of pytest the directory
where the gn_monitoring_module repo is (so with the frontend etc.)
  • Loading branch information
mvergez authored Dec 23, 2022
1 parent 3ae0a1f commit 62e95ba
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 6 additions & 0 deletions backend/gn_module_monitoring/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
from geonature.tests.fixtures import *
from geonature.tests.fixtures import _session, app, users

pytest_plugins = [
"gn_module_monitoring.tests.fixtures.module",
"gn_module_monitoring.tests.fixtures.site",
"gn_module_monitoring.tests.fixtures.sites_groups",
]
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
from geonature.utils.env import db

from gn_module_monitoring.monitoring.models import TMonitoringModules
from gn_module_monitoring.tests.fixtures.module import monitoring_module
from gn_module_monitoring.tests.fixtures.site import categories, site_type


@pytest.mark.usefixtures("temporary_transaction")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import pytest
from flask import url_for

from gn_module_monitoring.tests.fixtures.site import categories, site_type, sites


@pytest.mark.usefixtures("client_class", "temporary_transaction")
class TestSite:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import pytest
from flask import url_for

from gn_module_monitoring.tests.fixtures.sites_groups import sites_groups


@pytest.mark.usefixtures("client_class", "temporary_transaction")
class TestSitesGroups:
Expand Down

0 comments on commit 62e95ba

Please sign in to comment.