Backport of CKAN 2.9 pytest plugin and fixtures to CAKN 2.8
Project description
CKAN 2.8 Pytest Plugin and Fixtures
This project backports the pytest
environment for CKAN from CKAN 2.9 to CKAN
2.8. This allows CKAN extension developers to test CKAN plugins built to
work with CKAN 2.8 as well as CKAN 2.9 or newer using a single unified test
suite.
Installation & Usage
To use this in your project:
- Add this library to your CKAN plugin project
- Write your tests with pytest (you can use CKAN fixtures as described below)
- Run
pytest
- When tested with CKAN 2.9 or newer, CKAN's built-in pytest plugin and fixtures will be used
- When tested with older versions of CKAN, the code in
pytest_ckan
will be used instead
Adding to CKAN project
To use this plugin to test your CKAN extension, simply install this library to
your development / testing environment; If you maintain a
dev-requirements.txt
or test-requirements.txt
file you can add this
library to it.
Running Pytest
To enable CKAN testing, simply add --ckan-ini=<path/to/test.ini>
to your
pytest
command, for example:
pytest --ckan-ini=test.ini ckanext/yourextension/tests
Using CKAN Fixtures in Tests
TBD
License & Acknowledgement
This work is entirely based on @wardi's work for ckanext-scheming. It has been extracted so it can be re-used by other CKAN extensions.
ckanext-scheming is copyright (c) Her Majesty the Queen in Right of Canada, represented by the President of the Treasury Board, 2013-2018
This plugin is free software districuted under the terms of the MIT License. See COPYING for details.
Copyright 2020 (c) Viderum Inc. / Datopian
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pytest-ckan-0.0.11.tar.gz
.
File metadata
- Download URL: pytest-ckan-0.0.11.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.1.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/2.7.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 933dd2e440d9f6ba2a919530f116dcf5e05354a4b964fec3aa6787a44fdae5fa |
|
MD5 | d1b55f7ec263504eab2bbf2cc152393e |
|
BLAKE2b-256 | d4d417d5519a196072f7054bb4d1aac45ad7024b06a88b21ace905b6163a10a0 |
File details
Details for the file pytest_ckan-0.0.11-py2.py3-none-any.whl
.
File metadata
- Download URL: pytest_ckan-0.0.11-py2.py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.1.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/2.7.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 428abd958f85ff7ae97f17657336573845a50fea57843d7a8fcfa2f0df7f4c2f |
|
MD5 | 913e45109b7fcf6cdbc91a5c4a391f76 |
|
BLAKE2b-256 | de22c0e3df7d0d8d64adb683332362ba5288f8066137d8ae466032c355bf7c3d |