OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2015 The LUCI Authors. All rights reserved. | 2 # Copyright 2015 The LUCI Authors. All rights reserved. |
3 # Use of this source code is governed under the Apache License, Version 2.0 | 3 # Use of this source code is governed under the Apache License, Version 2.0 |
4 # that can be found in the LICENSE file. | 4 # that can be found in the LICENSE file. |
5 | 5 |
6 import os | |
7 import sys | |
8 import unittest | 6 import unittest |
9 | 7 |
10 import test_env | 8 import test_env |
11 | 9 |
12 from recipe_engine import recipe_test_api | 10 from recipe_engine import recipe_test_api |
13 | 11 |
14 class EXC(Exception): | 12 class EXC(Exception): |
15 pass | 13 pass |
16 | 14 |
17 class TestExpectedException(unittest.TestCase): | 15 class TestExpectedException(unittest.TestCase): |
(...skipping 23 matching lines...) Expand all Loading... |
41 | 39 |
42 def testDisabledTestData(self): | 40 def testDisabledTestData(self): |
43 """Disabled test data correctly re-raises all exceptions.""" | 41 """Disabled test data correctly re-raises all exceptions.""" |
44 test_data = recipe_test_api.TestData() | 42 test_data = recipe_test_api.TestData() |
45 | 43 |
46 with test_data.should_raise_exception(EXC()) as should_raise: | 44 with test_data.should_raise_exception(EXC()) as should_raise: |
47 self.assertTrue(should_raise) | 45 self.assertTrue(should_raise) |
48 | 46 |
49 if __name__ == '__main__': | 47 if __name__ == '__main__': |
50 unittest.main() | 48 unittest.main() |
OLD | NEW |