blob: b715377610d074473c7688c06662a50e68748d9a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
""" Test that import errors are detected. """
# pylint: disable=invalid-name, unused-import, no-absolute-import, bare-except, broad-except
import totally_missing # [import-error]
try:
import maybe_missing
except ImportError:
maybe_missing = None
try:
import maybe_missing_1
except (ImportError, SyntaxError):
maybe_missing_1 = None
try:
import maybe_missing_2 # [import-error]
except ValueError:
maybe_missing_2 = None
try:
import dont_emit
except Exception:
pass
try:
import please_dont_emit
except:
pass
try:
if maybe_missing:
import really_missing
except ImportError:
pass
from .collections import missing # [import-error]
|