diff -r 16a09ae318b4 -r 26a4e46af2bc tests/test-demandimport.py --- a/tests/test-demandimport.py Tue Sep 27 21:56:00 2016 +0900 +++ b/tests/test-demandimport.py Mon Sep 26 23:28:57 2016 +0900 @@ -63,6 +63,15 @@ print("re.stderr =", f(re.stderr)) print("re =", f(re)) +import contextlib +print("contextlib =", f(contextlib)) +try: + from contextlib import unknownattr + print('no demandmod should be created for attribute of non-package ' + 'module:\ncontextlib.unknownattr =', f(unknownattr)) +except ImportError as inst: + print('contextlib.unknownattr = ImportError: %s' % inst) + demandimport.disable() os.environ['HGDEMANDIMPORT'] = 'disable' # this enable call should not actually enable demandimport!