This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Plugin for py.test that integrates with github using markers. Integration allows tests to xfail (or skip) based on the status of linked github issues.

Installation

Install the plugin using pip

pip install pytest-github

Usage

  1. Once installed, the following py.test command-line parameters are available.
py.test \
    [--github-cfg=GITHUB_CFG] \
    [--github-username=GITHUB_USERNAME] \
    [--github-token=GITHUB_TOKEN] \
    [--github-completed=GITHUB_COMPLETED] \
    [--github-summary]
  1. Next, create a configure file called github.yml that contains your GitHub username and personal api token. A sample file is included below.
github:
    username: j.doe
    token: XXXXXXXXXXXXX

Marker

The following py.test marker is available:

@pytest.mark.github(*args): GitHub issue integration

The marker can be used to influence the outcome of tests. See the examples below for guidance.

Example: xfail

Often, when a test fails, one might file a GitHub issue to track the resolution of the problem. Alternatively, you could use the built-in xfail marker. This is where pytest-github can be of use. To avoid having to review known failures with each test run, and to avoid always using xfail, consider the github marker to dynamically influence the test outcome based on the state of the GitHub issue.

The following example demonstrates using the github marker to influence the outcome of a known failing test.

@pytest.mark.github('https://github.com/some/open/issues/1')
def test_will_xfail():
    assert False

Running this test with py.test will produce the following output:

test.py::test_will_xfail xfail

Example: XPASS

The following example demonstrates a test that succeeds, despite being associated with an open GitHub issue.

@pytest.mark.github('https://github.com/some/open/issues/1')
def test_will_xpass():
    assert True

In this example, the XPASS outcome (a.k.a. unexpected pass) is used.

test.py::test_will_xpass XPASS

Example: PASSED

The following example demonstrates a test that succeeds, while it is associated with a closed GitHub issue. When a test associated with a GitHub

@pytest.mark.github('https://github.com/some/closed/issues/2')
def test_will_pass():
    assert True

In this example, the PASSED outcome is used.

test.py::test_will_pass PASSED

Example: FAILED

The following example demonstrates a test that fails, while it is associated with a closed GitHub issue.

@pytest.mark.github('https://github.com/some/closed/issues/2')
def test_will_fail():
    assert False

In this example, the FAILED outcome is used.

test.py::test_will_fail FAILED

Example: SKIPPED

The following example demonstrates a test that fails, while it is associated with an open GitHub issue.

@pytest.mark.github('https://github.com/some/open/issues/1', skip=True)
def test_will_skip():
    assert False

In this example, the SKIPPED outcome is used.

test.py::test_will_skip SKIPPED
Release History

Release History

0.0.8

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.7

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.6

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.5

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.4

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
pytest-github-0.0.8.tar.gz (8.2 kB) Copy SHA256 Checksum SHA256 Source Aug 2, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting