File: conftest.py

package info (click to toggle)
exhale 0.3.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,616 kB
  • sloc: python: 9,057; cpp: 1,260; javascript: 915; f90: 29; ansic: 18; makefile: 16
file content (40 lines) | stat: -rw-r--r-- 1,517 bytes parent folder | download
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
28
29
30
31
32
33
34
35
36
37
38
39
40
# -*- coding: utf8 -*-
########################################################################################
# This file is part of exhale.  Copyright (c) 2017-2024, Stephen McDowell.             #
# Full BSD 3-Clause license available here:                                            #
#                                                                                      #
#                https://github.com/svenevs/exhale/blob/master/LICENSE                 #
########################################################################################
"""
Global ``pytest`` configurations that are used / executed for every test.

See ``pytest`` documentation on `Package/Directory-level fixtures (setups)`__.

__ https://docs.pytest.org/en/latest/example/simple.html#package-directory-level-fixtures-setups
"""

from __future__ import unicode_literals

pytest_plugins = [
    "sphinx.testing.fixtures",
    "testing.fixtures"
]
"""Signals to ``pytest`` which plugins are needed for all tests."""


def pytest_configure(config):
    """Register ``@pytest.mark.exhale`` with PyTest."""
    config.addinivalue_line(
        "markers", "exhale: internal marker for testing metaclass."
    )
    # TODO: upstream this if not fixed already.
    config.addinivalue_line(
        "markers", "sphinx: register sphinx test."
    )


def pytest_runtest_setup(item):
    """.. todo:: stop reloading configs module in 1.x."""
    from six.moves import reload_module
    from exhale import configs
    reload_module(configs)