github3_utils.testing

Fixtures for pytest.

Attention

This module has the following additional requirements:

betamax>=0.8.1
pytest>=6.0.0

These can be installed as follows:

python -m pip install github3-utils[testing]

New in version 0.2.0.

To use this module you need to add, at a minimum, the following to your conftest.py:

from betamax import Betamax

pytest_plugins = ("github3_utils.testing", )

with Betamax.configure() as config:
    config.cassette_library_dir = "<path to cassettes directory>"

Functions:

cassette(request, github_client)

Provides a Betamax cassette scoped to the test function which record and plays back interactions with the GitHub API.

github_client()

Provides an instance of github3.github.GitHub, using a fake token to authenticate.

module_cassette(request, github_client)

Provides a Betamax cassette scoped to the test module which record and plays back interactions with the GitHub API.

fixture cassette[source]

Scope:    function

Provides a Betamax cassette scoped to the test function which record and plays back interactions with the GitHub API.

Return type

Iterator[GitHub]

fixture github_client[source]

Scope:    function

Provides an instance of github3.github.GitHub, using a fake token to authenticate.

Return type

GitHub

fixture module_cassette[source]

Scope:    function

Provides a Betamax cassette scoped to the test module which record and plays back interactions with the GitHub API.

Return type

Iterator[GitHub]