chore: move testing utils out of utils
This commit is contained in:
parent
55ec6323bb
commit
9abfabde00
7 changed files with 9 additions and 9 deletions
33
tests/integration/byteb4rb1e/testing/pytest/test_fixtures.py
Normal file
33
tests/integration/byteb4rb1e/testing/pytest/test_fixtures.py
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
from pathlib import Path
|
||||
import importlib.resources
|
||||
|
||||
import pytest
|
||||
|
||||
pytestmark = pytest.mark.pytest
|
||||
|
||||
from byteb4rb1e.testing.pytest.decorators import run_in_subprocess_once
|
||||
from byteb4rb1e.testing.pytest.fixtures import current_test, mock_pkg
|
||||
|
||||
|
||||
def test_current_test(current_test):
|
||||
"""
|
||||
"""
|
||||
suite_path, case_name = current_test
|
||||
|
||||
assert str(Path(__file__)) == str(suite_path)
|
||||
assert case_name == "test_current_test"
|
||||
|
||||
|
||||
@run_in_subprocess_once()
|
||||
def test_mock_pkg(mock_pkg):
|
||||
"""
|
||||
"""
|
||||
dummy_data = 'Hello'
|
||||
|
||||
mock_pkg('foobarpkg', {
|
||||
'data.txt': dummy_data
|
||||
})
|
||||
|
||||
result = next(importlib.resources.files('foobarpkg').glob('data.txt')).read_text()
|
||||
|
||||
assert result == dummy_data
|
||||
Loading…
Add table
Add a link
Reference in a new issue