Skip to content

Commit

Permalink
Rely on resources.__name__ for easier portability.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Aug 17, 2024
1 parent d618902 commit 90c0e42
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions importlib_resources/tests/test_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ class ModuleFilesZipTests(DirectSpec, util.ZipSetup, ModulesFiles, unittest.Test

class ImplicitContextFiles:
set_val = textwrap.dedent(
"""
import importlib_resources as res
f"""
import {resources.__name__} as res
val = res.files().joinpath('res.txt').read_text(encoding='utf-8')
"""
)
Expand All @@ -114,7 +114,7 @@ class ImplicitContextFiles:
'res.txt': 'resources are the best',
},
'frozenpkg': {
'__init__.py': set_val.replace('importlib_resources', 'c_resources'),
'__init__.py': set_val.replace(resources.__name__, 'c_resources'),
'res.txt': 'resources are the best',
},
}
Expand Down

0 comments on commit 90c0e42

Please sign in to comment.