diff options
| author | Rami Ali | 2017-01-16 15:45:55 +1100 |
|---|---|---|
| committer | Damien George | 2017-01-16 15:59:33 +1100 |
| commit | 50e14ca61945dcb5487e1b54d99fc84c530a32f7 (patch) | |
| tree | da48c943ad40f14b84a2f25a6596dbe00c5d4cc4 /tests/import/pkg7 | |
| parent | 8d01bd3a1cd00fa50017ef1d95f8f66e0b7a6365 (diff) | |
tests/import: Improve builtinimport.c test coverage.
Diffstat (limited to 'tests/import/pkg7')
| -rw-r--r-- | tests/import/pkg7/subpkg1/subpkg2/mod3.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/import/pkg7/subpkg1/subpkg2/mod3.py b/tests/import/pkg7/subpkg1/subpkg2/mod3.py index b85b34e60..747cde03b 100644 --- a/tests/import/pkg7/subpkg1/subpkg2/mod3.py +++ b/tests/import/pkg7/subpkg1/subpkg2/mod3.py @@ -2,3 +2,10 @@ from ... import mod1 from ...mod2 import bar print(mod1.foo) print(bar) + +# when attempting relative import beyond top-level package uPy raises ImportError +# whereas CPython raises a ValueError +try: + from .... import mod1 +except (ImportError, ValueError): + print('Error') |
