Skip to main content

py.test bugzilla integration plugin, using markers

Project description

Build Status Code Coverage

Intro

PyTest plugin for bugzilla integration. This plugin currently assumes the following workflow:

  • bug_status in [‘NEW’, ‘ASSIGNED’, ‘ON_DEV’] means the bug is known and is being worked on and therefore the test should be skipped and will be.

  • bug_status not in [‘NEW’, ‘ASSIGNED’, ‘ON_DEV’] means the bug is in a state ready for QE and the test will be run and reported on.

Please feel free to contribute by forking and submitting pull requests or by submitting feature requests or issues to issues

Requires

  • pytest >= 2.2.3

  • python-bugzilla >= 0.6.2

  • six

Installation

pip-python install pytest_marker_bugzilla

Usage

  1. Create a bugzilla.cfg in the root of your tests. You can also put it under $HOME and /etc.

    [DEFAULT]
    bugzilla_url = https://bugzilla.fqdn/xmlrpc.cgi
    # Username for authentication
    bugzilla_username = USERNAME (or blank for public bugs)
    # Password for authentication
    bugzilla_password = PASSWORD (or blank for public bugs)
    # Version of your product
    bugzilla_version = X.Y (or blank if not relevant)
    # Tuple of fixed_in and target_release attribute of bug
    bugzilla_loose = (leave blank for default)

    Options can be overridden with command line options.

    py.test --help
  2. Mark your tests with bugzilla marker and bug id(s).

    @pytest.mark.bugzilla('bug_id', ...)

    In order to skip the test, all of the specified bugs must lead to skipping. Even just one unskipped means that the test will not be skipped.

  3. Run py.test with bugzilla option to enable the plugin.

    py.test --bugzilla

Conditional guards

The conditional guards, are functions which can xfail or skip the test when condition is met.

@pytest.mark.bugzilla(1234, skip_when=lambda bug: bug.status == "POST")
@pytest.mark.bugzilla(
    567, xfail_when=lambda bug, version: bug.fixed_in > version
)

The guard is a function, it will receive max. 2 parameters. It depends what parameters you specify.

The parameters are:

  • bug - specific BZ bug

  • version - tested product version

Order or presence does not matter.

Test library

When you do changes please make sure that you pass current tests.

tox

Please also try to cover new features by writing new tests.

Enjoy.

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-marker-bugzilla-0.9.1.dev6.zip (17.5 kB view details)

Uploaded Source

Built Distribution

pytest_marker_bugzilla-0.9.1.dev6-py2.py3-none-any.whl (7.5 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file pytest-marker-bugzilla-0.9.1.dev6.zip.

File metadata

  • Download URL: pytest-marker-bugzilla-0.9.1.dev6.zip
  • Upload date:
  • Size: 17.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/3.7.4

File hashes

Hashes for pytest-marker-bugzilla-0.9.1.dev6.zip
Algorithm Hash digest
SHA256 e7d8eb5ec47345fe446f7e2d2c2ee28e031848a4cea78cc41c5aa73358e0cb98
MD5 c3b288dbdb473f8a0d491b312be34147
BLAKE2b-256 873b7cf6d96f89e7db6298b0a832be8fb7c14900db9caabe18553271ccc53a6f

See more details on using hashes here.

File details

Details for the file pytest_marker_bugzilla-0.9.1.dev6-py2.py3-none-any.whl.

File metadata

  • Download URL: pytest_marker_bugzilla-0.9.1.dev6-py2.py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/3.7.4

File hashes

Hashes for pytest_marker_bugzilla-0.9.1.dev6-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 1efafdf5093cc19ffdf2c6fe4acead59964c7b5d69d9aa39bb400d83561f54eb
MD5 7230985c6b4e81655b1aae4341c6228e
BLAKE2b-256 95e859a1d56f256c130267baf9f8c78e31527ea7a0718f54427dfb6c92719348

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