ok, seems that import_dir is a bit saner
This commit is contained in:
parent
44aa062756
commit
0f80e9d5e6
3 changed files with 16 additions and 3 deletions
|
@ -104,7 +104,14 @@ def prepare(tmp_path: Path):
|
|||
''')
|
||||
ext = tmp_path / 'external'
|
||||
ext.mkdir()
|
||||
(ext / '__init__.py').write_text('identity = lambda x: x')
|
||||
(ext / '__init__.py').write_text('''
|
||||
def identity(x):
|
||||
from .submodule import hello
|
||||
hello(x)
|
||||
return x
|
||||
|
||||
''')
|
||||
(ext / 'submodule.py').write_text('hello = lambda x: print("hello " + str(x))')
|
||||
yield
|
||||
ex = 'my.config.repos.external'
|
||||
if ex in sys.modules:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue