Skip to main content

pytest plugin with mechanisms for echoing environment variables, package version and generic attributes

Project description

https://pypip.in/v/pytest-echo/badge.png https://pypip.in/d/pytest-echo/badge.png

Print environment variables, package version and generic attributes.

Useful in the continuous integration to dump test configuration/environment.

Install

install via:

pip install pytest-echo

The plugin provides ability to print some extra information prior to run the tests.

Example

Dump environment variables

$ py.test --echo-env=HOME
============================= test session starts =========================
platform linux2 -- Python 2.7.4 -- py-1.4.22 -- pytest-2.6.0 -- /bin/python
HOME: /home/sax
plugins: echo, pydev, cov, cache, django

Dump package version

$ py.test --echo-version=pytest_echo
============================= test session starts =========================
platform linux2 -- Python 2.7.4 -- py-1.4.22 -- pytest-2.6.0 -- /bin/python
pytest_echo: 0.1
plugins: echo, pydev, cov, cache, django

Dump attributes

$ py.test --echo-attr=django.conf.settings.DEBUG
============================= test session starts =========================
platform linux2 -- Python 2.7.4 -- py-1.4.22 -- pytest-2.6.0 -- /bin/python
DEBUG: False
plugins: echo, pydev, cov, cache, django

Configure via tox.ini/setup.cfg/pytest.cfg

Example of use in a django project:

[pytest]
        --tb=short
        --capture=no
        --echo-env PWD
        --echo-env VIRTUAL_ENV
        --echo-env DBENGINE
        --echo-version django
        --echo-version pip
        --echo-version pytest_echo
        --echo-attr django.conf.settings.DATABASES.default.ENGINE
$ py.test
============================= test session starts =========================
platform linux2 -- Python 2.7.4 -- py-1.4.22 -- pytest-2.6.0 -- /bin/python
Environment:
    DJANGO_SETTINGS_MODULE: tests.settings
    PWD: /data/PROGETTI/ONU_WorldFoodProgramme/wfp-auth
    VIRTUAL_ENV: /data/VENV/sem
    DBENGINE: <not set>
Package version:
    django: 1.6.5
    pip: 1.5.6
    pytest_echo: 1.2
Inspections:
    django.conf.settings.DATABASES.default.ENGINE: 'django.db.backends.postgresql_psycopg2'

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-echo-1.3.tar.gz (10.3 kB view details)

Uploaded Source

File details

Details for the file pytest-echo-1.3.tar.gz.

File metadata

  • Download URL: pytest-echo-1.3.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pytest-echo-1.3.tar.gz
Algorithm Hash digest
SHA256 7e74ecbf463c64e61015297bd7c4f3cffc07f9eabc071124460d0fae47a380af
MD5 2f64ca4e4fd062fb64acfa1a5f6d5106
BLAKE2b-256 b294bfcd13c938b1c1f2465b7c0bee40969a130da40ba57ae78c5ea7f46a668d

See more details on using hashes here.

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