def test_import_autoconfigure__file__with_py_exts(self): |
for ext in '.pyc', '.pyo': |
testpath = self.initdir2 / ('autoconfiguretest' + ext) |
d = {'__file__' : str(testpath)} |
oldsyspath = sys.path[:] |
try: |
exec self.getauto in d |
conf = d['autopath'] |
assert conf == self.initdir2.join('autoconfiguretest.py') |
assert conf.pkgdir == self.initdir |
assert str(self.root) in sys.path |
-> exec self.getauto in d |
assert conf is not d['autopath'] |
finally: |
sys.path[:] = oldsyspath |