Skip to content

Commit

Permalink
Decouple tests from ckanext-harvest
Browse files Browse the repository at this point in the history
This way the non-harvest related tests can be run without having to
install ckanext-harvest
  • Loading branch information
amercader committed Apr 16, 2024
1 parent b8ebf24 commit 41720d1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
9 changes: 6 additions & 3 deletions ckanext/dcat/tests/test_harvester.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# -*- coding: utf-8 -*-
import pytest

pytest.importorskip("ckanext.harvest", reason="Harvest extension not installed")

from builtins import str
from builtins import range
from builtins import object
from collections import defaultdict
import re

import pytest
import responses
try:
from unittest.mock import patch
Expand All @@ -17,13 +19,14 @@
from ckantoolkit import config
from ckantoolkit.tests import helpers

import ckanext.harvest.model as harvest_model
from ckanext.harvest import queue


from ckanext.dcat.harvesters import DCATRDFHarvester
from ckanext.dcat.interfaces import IDCATRDFHarvester
import ckanext.dcat.harvesters.rdf

import ckanext.harvest.model as harvest_model
from ckanext.harvest import queue



Expand Down
5 changes: 4 additions & 1 deletion ckanext/dcat/tests/test_json_harvester.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
from __future__ import absolute_import
import pytest

pytest.importorskip("ckanext.harvest", reason="Harvest extension not installed")

from builtins import object

import responses
import pytest
try:
from unittest.mock import patch
except ImportError:
Expand Down
2 changes: 1 addition & 1 deletion test.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ port = 5000

[app:main]
use = config:../ckan/test-core.ini
ckan.plugins = dcat harvest
ckan.plugins = dcat
ckanext.dcat.enable_content_negotiation=True

# Needed for the harvest tests
Expand Down

0 comments on commit 41720d1

Please sign in to comment.