Skip to content
This repository has been archived by the owner on Mar 22, 2021. It is now read-only.

Commit

Permalink
Make plugin auto-used by pytest when installed
Browse files Browse the repository at this point in the history
  • Loading branch information
Shahar Evron committed Apr 27, 2020
1 parent 24bc616 commit bf2c406
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
8 changes: 8 additions & 0 deletions pytest_ckan/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
"""Plugin entrypoint
Prefer loading CKAN's built in pytest environment. If not found, fall back to
the implementation bundled in this package
"""

try:
from ckan.tests.pytest_ckan.ckan_setup import *
from ckan.tests.pytest_ckan.fixtures import *
except ImportError:
from .impl.plugin import *
from .impl.fixtures import *
4 changes: 0 additions & 4 deletions pytest_ckan/fixtures.py

This file was deleted.

1 change: 1 addition & 0 deletions pytest_ckan/impl/plugin.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
import os
import sys

Expand Down
7 changes: 6 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,10 @@
description='Backport of CKAN 2.9 pytest plugin and fixtures to CAKN 2.8',
author='Shahar Evron',
author_email='[email protected]',
install_requires=[],
install_requires=[
'pytest',
'ckan'
],
entry_points={"pytest11": ["ckan = pytest_ckan"]},
classifiers=["Framework :: Pytest"],
)

0 comments on commit bf2c406

Please sign in to comment.