fixed #404 - --fail-fast option was broken
Showing
4 changed files
with
26 additions
and
0 deletions
tests/clitests/fail-fast/standard/test1.js
0 → 100644
tests/clitests/fail-fast/standard/test2.js
0 → 100644
tests/clitests/fail-fast/standard/test3.js
0 → 100644
... | @@ -54,6 +54,8 @@ class CasperExecTest(unittest.TestCase): | ... | @@ -54,6 +54,8 @@ class CasperExecTest(unittest.TestCase): |
54 | self.assertEquals(self.runCommand(cmd), result) | 54 | self.assertEquals(self.runCommand(cmd), result) |
55 | 55 | ||
56 | def assertCommandOutputContains(self, cmd, what, **kwargs): | 56 | def assertCommandOutputContains(self, cmd, what, **kwargs): |
57 | if not what: | ||
58 | raise AssertionError('Empty lookup') | ||
57 | if isinstance(what, (list, tuple)): | 59 | if isinstance(what, (list, tuple)): |
58 | for entry in what: | 60 | for entry in what: |
59 | self.assertIn(entry, self.runCommand(cmd, **kwargs)) | 61 | self.assertIn(entry, self.runCommand(cmd, **kwargs)) |
... | @@ -149,5 +151,17 @@ class CasperExecTest(unittest.TestCase): | ... | @@ -149,5 +151,17 @@ class CasperExecTest(unittest.TestCase): |
149 | 'assert: Subject is strictly true', | 151 | 'assert: Subject is strictly true', |
150 | ], failing=True) | 152 | ], failing=True) |
151 | 153 | ||
154 | @timeout(60) | ||
155 | def test_fail_fast(self): | ||
156 | folder_path = os.path.join(TEST_ROOT, 'fail-fast') | ||
157 | self.assertCommandOutputContains('test %s --fail-fast' % folder_path, [ | ||
158 | '# test 1', | ||
159 | '# test 2', | ||
160 | '--fail-fast: aborted all remaining tests', | ||
161 | 'FAIL 2 tests executed', | ||
162 | '1 passed', | ||
163 | '1 failed', | ||
164 | ], failing=True) | ||
165 | |||
152 | if __name__ == '__main__': | 166 | if __name__ == '__main__': |
153 | unittest.main() | 167 | unittest.main() | ... | ... |
-
Please register or sign in to post a comment