Skip to content
This repository has been archived by the owner on Jun 22, 2023. It is now read-only.

Commit

Permalink
Drop useless "will dump results to ..." line
Browse files Browse the repository at this point in the history
  • Loading branch information
ichard26 committed Jul 25, 2021
1 parent cc3585a commit 63ea2ce
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
6 changes: 4 additions & 2 deletions src/blackbench/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,11 +288,13 @@ def cmd_run(
f" for the `{task.name}` task."
)

pretty_dump_path = str(dump_path.relative_to(os.getcwd()))
if dump_path.exists():
try:
pretty_dump_path = dump_path.relative_to(os.getcwd())
except ValueError:
pretty_dump_path = dump_path
warn(f"A file / directory already exists at `{pretty_dump_path}`.")
click.confirm("[*] Do you want to overwrite and continue?", abort=True)
log(f"Will dump results to `{pretty_dump_path}`.")

benchmarks = [Benchmark(task, target) for target in targets]

Expand Down
15 changes: 7 additions & 8 deletions tests/integration_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,15 @@ def test_run_cmd(tmp_result: Path, run_cmd):
assert tmp_result.read_text("utf8") == good_result

output_lines = result.output.splitlines()
assert len(output_lines) == 15
assert len(output_lines) == 14
assert "ERROR" not in result.output and "WARNING" not in result.output
assert output_lines[0].startswith("[*] Versions: blackbench: ")
assert output_lines[1] == "[*] Will dump results to `results.json`."
assert output_lines[2].startswith("[*] Created temporary workdir at `")
assert output_lines[3] == "[*] Alright, let's start!"
assert output_lines[4] == "[*] Running `fmt-goodbye-internet` benchmark (1/4)"
assert output_lines[6] == "[*] Running `fmt-hello-world` benchmark (2/4)"
assert output_lines[8] == "[*] Running `fmt-i/heard/you/like/nested` benchmark (3/4)"
assert output_lines[10] == "[*] Running `fmt-tiny` microbenchmark (4/4)"
assert output_lines[1].startswith("[*] Created temporary workdir at `")
assert output_lines[2] == "[*] Alright, let's start!"
assert output_lines[3] == "[*] Running `fmt-goodbye-internet` benchmark (1/4)"
assert output_lines[5] == "[*] Running `fmt-hello-world` benchmark (2/4)"
assert output_lines[7] == "[*] Running `fmt-i/heard/you/like/nested` benchmark (3/4)"
assert output_lines[9] == "[*] Running `fmt-tiny` microbenchmark (4/4)"
assert output_lines[-3] == "[*] Cleaning up."
assert output_lines[-2] == "[*] Results dumped."
assert output_lines[-1].startswith("[*] Blackbench run finished in")
Expand Down

0 comments on commit 63ea2ce

Please sign in to comment.