introspection
This commit is contained in:
18
tests/introspection/conftest.py
Normal file
18
tests/introspection/conftest.py
Normal file
@@ -0,0 +1,18 @@
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def temp_package(tmp_path: Path):
|
||||
"""
|
||||
Creates a temporary Python package and adds it to sys.path.
|
||||
"""
|
||||
pkg = tmp_path / "testpkg"
|
||||
pkg.mkdir()
|
||||
(pkg / "__init__.py").write_text('"""Test package."""\n')
|
||||
|
||||
sys.path.insert(0, str(tmp_path))
|
||||
yield pkg
|
||||
sys.path.remove(str(tmp_path))
|
||||
Reference in New Issue
Block a user