(cap_out, store, tempdir_factory)
| 400 | |
| 401 | |
| 402 | def test_run_output_logfile(cap_out, store, tempdir_factory): |
| 403 | expected_output = ( |
| 404 | b'This is STDOUT output\n', |
| 405 | b'This is STDERR output\n', |
| 406 | ) |
| 407 | |
| 408 | git_path = make_consuming_repo(tempdir_factory, 'logfile_repo') |
| 409 | with cwd(git_path): |
| 410 | _test_run( |
| 411 | cap_out, |
| 412 | store, |
| 413 | git_path, {}, |
| 414 | expected_output, |
| 415 | expected_ret=1, |
| 416 | stage=True, |
| 417 | ) |
| 418 | logfile_path = os.path.join(git_path, 'test.log') |
| 419 | assert os.path.exists(logfile_path) |
| 420 | with open(logfile_path, 'rb') as logfile: |
| 421 | logfile_content = logfile.readlines() |
| 422 | |
| 423 | for expected_output_part in expected_output: |
| 424 | assert expected_output_part in logfile_content |
| 425 | |
| 426 | |
| 427 | def test_always_run(cap_out, store, repo_with_passing_hook): |
nothing calls this directly
no test coverage detected