Skip to content

Commit 82a5d0b

Browse files
committed
Use importlib_resources to load the local resource.
1 parent 2c6b8c4 commit 82a5d0b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

setup.cfg

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ testing =
4343
pytest-enabler >= 1.3
4444

4545
# local
46+
importlib-resources@git+https://github.com/python/importlib_resources@feature/203-non-package-modules
4647

4748
docs =
4849
# upstream

tests/test_officepack.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
import pathlib
2-
31
import pytest
2+
import importlib_resources as resources
43

54
from openpack.officepack import OfficePackage
65

76

87
@pytest.fixture
98
def officepack_sample(request):
10-
return pathlib.Path(__file__).parent.joinpath('empty.docx').open('rb')
9+
return resources.files(__name__).joinpath('empty.docx').open('rb')
1110

1211

1312
def test_open(officepack_sample):

0 commit comments

Comments
 (0)