Skip to content

Commit

Permalink
Add tests to ensure we can combine -t and -c in opal test refs #1502
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmiller committed Apr 14, 2018
1 parent 5d6711a commit bd6e22b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions opal/tests/test_core_test_runner.py
Expand Up @@ -59,6 +59,19 @@ def test_run_tests_with_coverage(self, check_call):

check_call.assert_has_calls(calls)

@patch('subprocess.check_call')
def test_run_tests_with_coverage_and_test_arg(self, check_call):
mock_args = MagicMock(name="args")
mock_args.userland_here = ffs.Path('.')
mock_args.coverage = True
mock_args.test = 'opal.tests.foo'
mock_args.failfast = False
test_runner._run_py_tests(mock_args)
calls = [
call(['coverage', 'run', 'runtests.py', 'opal.tests.foo']),
call(['coverage', 'html'])
]

@patch('subprocess.check_call')
@patch.object(test_runner.sys, 'exit')
def test_run_tests_with_coverage_errors(self, exiter, check_call):
Expand Down

0 comments on commit bd6e22b

Please sign in to comment.