def test_import_autoconfigure___file__without_init(self): |
testpath = self.root / 'autoconfiguretest.py' |
d = {'__file__' : str(testpath)} |
oldsyspath = sys.path[:] |
try: |
exec self.getauto in d |
conf = d['autopath'] |
assert conf.dirpath() == self.root |
assert conf.pkgdir == self.root |
syspath = sys.path[:] |
assert str(self.root) in syspath |
-> exec self.getauto in d |
assert conf is not d['autopath'] |
finally: |
sys.path[:] = oldsyspath |