Sha256: c9782c767eb86315e98206c56571a727d552a3f86ee2baac899f0303be14a4c8

Contents?: true

Size: 839 Bytes

Versions: 42

Compression:

Stored size: 839 Bytes

Contents

"""Astroid hooks for pytest."""

from astroid import MANAGER, register_module_extender
from astroid.builder import AstroidBuilder


def pytest_transform():
    return AstroidBuilder(MANAGER).string_build('''

try:
    import _pytest.mark
    import _pytest.recwarn
    import _pytest.runner
    import _pytest.python
except ImportError:
    pass
else:
    deprecated_call = _pytest.recwarn.deprecated_call
    exit = _pytest.runner.exit
    fail = _pytest.runner.fail
    fixture = _pytest.python.fixture
    importorskip = _pytest.runner.importorskip
    mark = _pytest.mark.MarkGenerator()
    raises = _pytest.python.raises
    skip = _pytest.runner.skip
    yield_fixture = _pytest.python.yield_fixture

''')

register_module_extender(MANAGER, 'pytest', pytest_transform)
register_module_extender(MANAGER, 'py.test', pytest_transform)

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
libv8-6.3.292.48.1 vendor/depot_tools/third_party/logilab/astroid/brain/py2pytest.py
libv8-6.3.292.48.0 vendor/depot_tools/third_party/logilab/astroid/brain/py2pytest.py
libv8-6.3.292.48.0beta2 vendor/depot_tools/third_party/logilab/astroid/brain/py2pytest.py
libv8-6.3.292.48.0beta1 vendor/depot_tools/third_party/logilab/astroid/brain/py2pytest.py
libv8-6.2.414.42.1 vendor/depot_tools/third_party/logilab/astroid/brain/py2pytest.py
libv8-6.2.414.42.0 vendor/depot_tools/third_party/logilab/astroid/brain/py2pytest.py
libv8-6.2.414.42.0beta1 vendor/depot_tools/third_party/logilab/astroid/brain/py2pytest.py
libv8-6.0.286.54.3 vendor/depot_tools/third_party/logilab/astroid/brain/py2pytest.py
libv8-6.0.286.54.2 vendor/depot_tools/third_party/logilab/astroid/brain/py2pytest.py
libv8-6.0.286.54.1 vendor/depot_tools/third_party/logilab/astroid/brain/py2pytest.py
libv8-6.0.286.54.0 vendor/depot_tools/third_party/logilab/astroid/brain/py2pytest.py
libv8-6.0.286.54.0beta2 vendor/depot_tools/third_party/logilab/astroid/brain/py2pytest.py
libv8-6.0.286.54.0beta1 vendor/depot_tools/third_party/logilab/astroid/brain/py2pytest.py
libv8-6.0.286.44.0beta1 vendor/depot_tools/third_party/logilab/astroid/brain/py2pytest.py
libv8-5.9.211.38.1 vendor/depot_tools/third_party/logilab/astroid/brain/py2pytest.py
libv8-5.9.211.38.0 vendor/depot_tools/third_party/logilab/astroid/brain/py2pytest.py
libv8-5.9.211.38.0beta0 vendor/depot_tools/third_party/logilab/astroid/brain/py2pytest.py
libv8-5.7.492.65.1 vendor/depot_tools/third_party/logilab/astroid/brain/py2pytest.py
libv8-5.7.492.65.0 vendor/depot_tools/third_party/logilab/astroid/brain/py2pytest.py
libv8-5.7.492.65.0beta1 vendor/depot_tools/third_party/logilab/astroid/brain/py2pytest.py