Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
1.0.3 (unreleased)
------------------

- Provide top-level ``pytest_xprocess`` module compatibility shim for downstream imports (`#163 <https://github.com/pytest-dev/pytest-xprocess/issues/163>`_)


1.0.1 (2024-04-31)
------------------

Expand Down
29 changes: 29 additions & 0 deletions pytest_xprocess.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
from xprocess import ProcessStarter
from xprocess import XProcess
from xprocess import XProcessInfo
from xprocess import XProcessResources
from xprocess.pytest_xprocess import get_log_files
from xprocess.pytest_xprocess import getrootdir
from xprocess.pytest_xprocess import InterruptionHandler
from xprocess.pytest_xprocess import pytest_addoption
from xprocess.pytest_xprocess import pytest_cmdline_main
from xprocess.pytest_xprocess import pytest_configure
from xprocess.pytest_xprocess import pytest_runtest_makereport
from xprocess.pytest_xprocess import pytest_unconfigure
from xprocess.pytest_xprocess import xprocess

__all__ = [
"InterruptionHandler",
"ProcessStarter",
"XProcess",
"XProcessInfo",
"XProcessResources",
"get_log_files",
"getrootdir",
"pytest_addoption",
"pytest_cmdline_main",
"pytest_configure",
"pytest_runtest_makereport",
"pytest_unconfigure",
"xprocess",
]
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ classifiers=

[options]
packages = find:
py_modules = pytest_xprocess
python_requires = >= 3.8

[options.packages.find]
Expand All @@ -38,6 +39,7 @@ branch = true
include =
xprocess/xprocess.py
xprocess/pytest_xprocess.py
pytest_xprocess.py

[flake8]
# B = bugbear
Expand Down
28 changes: 28 additions & 0 deletions tests/test_top_level_import.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import importlib.util

import pytest_xprocess
from pytest_xprocess import getrootdir
from pytest_xprocess import ProcessStarter
from pytest_xprocess import XProcess
from pytest_xprocess import XProcessInfo
from pytest_xprocess import XProcessResources
from xprocess import ProcessStarter as InternalProcessStarter
from xprocess import XProcess as InternalXProcess
from xprocess import XProcessInfo as InternalXProcessInfo
from xprocess import XProcessResources as InternalXProcessResources
from xprocess.pytest_xprocess import getrootdir as internal_getrootdir


def test_top_level_pytest_xprocess_spec():
spec = importlib.util.find_spec("pytest_xprocess")
assert spec is not None
assert spec.origin is not None


def test_top_level_pytest_xprocess_exports():
assert getrootdir is internal_getrootdir
assert ProcessStarter is InternalProcessStarter
assert XProcess is InternalXProcess
assert XProcessInfo is InternalXProcessInfo
assert XProcessResources is InternalXProcessResources
assert hasattr(pytest_xprocess, "xprocess")