Chromium Code Reviews| Index: typ/tests/main_test.py |
| diff --git a/typ/tests/main_test.py b/typ/tests/main_test.py |
| index 75fb3354b096ccfbe7fe8e4a5067dbe40fdd4d77..bec1c554b81af27e1c2133c2ffada5d3dac06a0d 100644 |
| --- a/typ/tests/main_test.py |
| +++ b/typ/tests/main_test.py |
| @@ -358,8 +358,8 @@ class TestCli(test_case.MainTestCase): |
| self.check(['--help'], ret=0, rout='.*', err='') |
| def test_import_failure_missing_file(self): |
| - self.check(['-l', 'foo'], ret=1, err='', |
| - rout='Failed to load "foo".*') |
| + _, out, _, _ = self.check(['-l', 'foo'], ret=1, err='') |
| + self.assertIn('Failed to load "foo" in find_tests', out) |
|
nednguyen
2016/09/24 01:51:45
Can you assert the out message contains the except
Dirk Pranke
2016/10/11 23:48:33
Done.
|
| def test_import_failure_missing_package(self): |
| files = {'foo.py': d("""\ |
| @@ -370,13 +370,13 @@ class TestCli(test_case.MainTestCase): |
| def test_case(self): |
| pass |
| """)} |
| - self.check(['-l', 'foo.py'], files=files, ret=1, err='', |
| - rout=('Failed to load "foo.py":')) |
| + _, out, _, _ = self.check(['-l', 'foo.py'], files=files, ret=1, err='') |
| + self.assertIn('Failed to load "foo.py" in find_tests', out) |
|
nednguyen
2016/09/24 01:51:45
ditto
Dirk Pranke
2016/10/11 23:48:33
Done.
|
| def test_import_failure_no_tests(self): |
| files = {'foo.py': 'import unittest'} |
| - self.check(['-l', 'foo.bar'], files=files, ret=1, err='', |
| - rout='Failed to load "foo.bar":.*') |
| + _, out, _, _ = self.check(['-l', 'foo.bar'], files=files, ret=1, err='') |
| + self.assertIn('Failed to load "foo.bar" in find_tests', out) |
|
Dirk Pranke
2016/10/11 23:48:33
I'm not actually sure what I thought I was testing
|
| def test_import_failure_syntax_error(self): |
| files = {'syn_test.py': d("""\ |