1 """Check that we handle an ImportError in a special way when command script importing files."""
3 from __future__ import print_function
9 from lldbsuite.test.decorators import *
10 from lldbsuite.test.lldbtest import *
11 from lldbsuite.test import lldbutil
13 class Rdar12586188TestCase(TestBase):
15 mydir = TestBase.compute_mydir(__file__)
17 @add_test_categories(['pyapi'])
19 def test_rdar12586188_command(self):
20 """Check that we handle an ImportError in a special way when command script importing files."""
24 # Call super's setUp().
28 """Check that we handle an ImportError in a special way when command script importing files."""
30 self.expect("command script import ./fail12586188.py --allow-reload",
31 error=True, substrs = ['raise ImportError("I do not want to be imported")'])
32 self.expect("command script import ./fail212586188.py --allow-reload",
33 error=True, substrs = ['raise ValueError("I do not want to be imported")'])