Skip to main content

Pytest fixtures for Invenio.

Project description

https://github.com/inveniosoftware/pytest-invenio/workflows/CI/badge.svg https://img.shields.io/coveralls/inveniosoftware/pytest-invenio.svg https://img.shields.io/pypi/v/pytest-invenio.svg

Pytest fixtures for Invenio.

The package offers a number of features to help test Invenio based applications:

  • Less boilerplate: Using the fixtures you can keep your conftest.py short and focused.

  • Database re-use: database tests are running inside a transaction which is rolled back after the test.

  • End-to-end testing: Selenium tests can easily be switched on/off, and in case of test failures a screenshot is taken (with possibility to output in the console in base64-encoding - useful on e.g. TravisCI).

  • Application configuration for testing (e.g. disable CSRF protection in forms and HTTPS requirement).

  • JSON decoding support in Flask test client for easier API testing.

  • Batteries included: further fixtures help with e.g. mail sending and CLI tests.

Further documentation is available on https://pytest-invenio.readthedocs.io/.

Changes

Version 1.4.6 (released 2022-02-29)

  • Adds support for Invenio-Accounts 2.0 in the UserFixture.

Version 1.4.5 (released 2022-02-23)

  • Fixes an import so that pytest-invenio is now usable without Invenio-Accounts installed.

Version 1.4.4 (released 2022-02-21)

  • Adds new UserFixture for easier test user creation.

Version 1.4.3 (released 2022-02-18)

  • Adds support for using importlib_metadata to read the patched entry points.

Version 1.4.2 (released 2021-05-11)

  • Add APP_THEME and THEME_ICONS in default app config, often needed when testing invenio packages that will render templates.

Version 1.4.1 (released 2020-12-17)

  • Remove pytest-celery because it’s still an alpha release.

Version 1.4.0 (released 2020-09-16)

  • BACKWARD INCOMPATIBLE: Changes to use isort, pycodestyle and pydocstyle via pytest plugins. You need to update pytest.ini and remove the --pep8 from the addopts and instead add --isort --pydocstyle --pycodestyle:

    addopts = --isort --pydocstyle --pycodestyle ...

    In ./run-tests.sh script you should also remove calls to pydocstyle and isort as both are now integrated with pytest.

  • BACKWARD INCOMPATIBLE: Upgrade dependencies: coverage, pytest-flask, check-manifest, pytest. You need to set the pytest-flask live server fixture scope in your pytest config:

    [pytest]
    live_server_scope = function
  • Decommission pytest-pep8 (last release in 2014) in favour of pycodestyle.

Version 1.3.4 (released 2020-09-15)

  • Add entrypoints fixture to allow injecting extra entry points during testing so that you avoid manual registration of e.g. mappings and schemas.

Version 1.3.3 (released 2020-08-27)

  • Add docker-services-cli as dependency to enable Invenio modules to perform reproducible tests.

Version 1.3.2 (released 2020-05-19)

  • Move check-manifest, coverage, isort, pydocstyle, pytest-flask and pytest-pep8 from test to install requirements to provide them as centrally managed dependencies.

Version 1.3.1 (released 2020-05-12)

  • Uninstalls numpy in Travis due to incompatibilities with elasticsearch-py.

Version 1.3.0 (released 2020-03-19)

  • Removes support for Python 2.7.

Version 1.2.2 (released 2020-05-07)

  • Uninstalls numpy in Travis due to incompatibilities with elasticsearch-py.

  • Deprecated Python versions lower than 3.6.0. Now supporting 3.6.0.

  • Set maximum version of Werkzeug to 1.0.0 due to incompatible imports.

  • Set maximum version of Flask to 1.1.0 due to incompatible imports.

  • Set maximum version of Pytest-Flask to 1.0.0 due to breaking changes.

  • Set minimum version of Invenio-Search to 1.2.3 and maximum to 1.3.0.

Version 1.2.1 (released 2019-11-13)

  • Fixes instance path fixture to also set the static folder.

Version 1.2.0 (released 2019-07-31)

  • Adds fixture for creating default Location.

  • Adds fixture for creating Bucket from directory with files.

Version 1.1.1 (released 2019-05-21)

  • Adds pytest-cov as install dependency.

Version 1.1.0 (released 2019-02-15)

  • Changes name of fixture from celery_config to celery_config_ext due to unreliable overwriting of celery_config fixture name.

Version 1.0.6 (released 2018-12-03)

  • Fixes overwriting of celery_config fixture

Version 1.0.5 (released 2018-10-08)

  • Adds default Content Security Policy header to the app configuration.

  • Fixes issue with default tests scope.

Version 1.0.4 (released 2018-08-14)

  • Bumps pytest minimun version to 3.8.0.

Version 1.0.3 (released 2018-09-05)

  • Moves module dependent imports inside the fixture functions in order to decouple dependencies for Invenio apps or modules that might not be using them.

Version 1.0.2 (released 2018-05-25)

Version 1.0.1 (released 2018-04-17)

Version 1.0.0 (released 2018-03-22)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest-invenio-1.4.6.tar.gz (37.7 kB view details)

Uploaded Source

Built Distribution

pytest_invenio-1.4.6-py2.py3-none-any.whl (22.4 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file pytest-invenio-1.4.6.tar.gz.

File metadata

  • Download URL: pytest-invenio-1.4.6.tar.gz
  • Upload date:
  • Size: 37.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.13

File hashes

Hashes for pytest-invenio-1.4.6.tar.gz
Algorithm Hash digest
SHA256 7071f3393d227402d0863d6ed5b69d3a4f3d9a77a5e3e3808a22c6256fd07643
MD5 08df5db9a9ec9abd4a0b5e05387908e2
BLAKE2b-256 59181c0daaa5f728df420f88b82281e3917c4a7d1f80e84841db1bcdbdd2bd5e

See more details on using hashes here.

Provenance

File details

Details for the file pytest_invenio-1.4.6-py2.py3-none-any.whl.

File metadata

  • Download URL: pytest_invenio-1.4.6-py2.py3-none-any.whl
  • Upload date:
  • Size: 22.4 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.13

File hashes

Hashes for pytest_invenio-1.4.6-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 eba244160925fe4f3f0fe76840a68a0b679b68b9f6d0f08fe92d33928921df36
MD5 32da7dc115167e0a7b7980f0b09570a3
BLAKE2b-256 04cfb7a77e709043fada5330b172db1755bd077ea7fd7cf206fb2e9b5e878d4f

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page