File: pytest_plugin.py

package info (click to toggle)
python-kgb 7.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 532 kB
  • sloc: python: 4,466; makefile: 3
file content (27 lines) | stat: -rw-r--r-- 392 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
"""Pytest plugin for kgb.

Version Added:
    7.0
"""

from __future__ import unicode_literals

import pytest

from kgb import SpyAgency


@pytest.fixture
def spy_agency():
    """Provide a KGB spy agency to a Pytest unit test.

    Yields:
        kgb.SpyAgency:
        The spy agency.
    """
    agency = SpyAgency()

    try:
        yield agency
    finally:
        agency.unspy_all()