Skip to content

Commit

Permalink
white_check_mark: Add coverage instructions to tests (#72)
Browse files Browse the repository at this point in the history
* ✅ Add coverage instructions to tests

* 📝 Update docs note about coverage in features

* 🎨 Fix format

* 🎨 Update testing docs format
  • Loading branch information
tiangolo committed Mar 19, 2020
1 parent 0830c02 commit a89fc4e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
8 changes: 2 additions & 6 deletions docs/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,8 @@ The resulting CLI apps created with **Typer** have the nice features of many "pr

But you can write simpler code with the benefits of modern Python.

<!--
TODO
### Tested
## Tested

* 100% <abbr title="The amount of code that is automatically tested">test coverage</abbr>.
* 100% <abbr title="Python type annotations, with this your editor and external tools can give you better support">type annotated</abbr> code base.
* Used in production applications. -->
* Used in production applications.
2 changes: 1 addition & 1 deletion docs/tutorial/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ collected 1 item

---> 100%

test_main.py <span style="color: green;">. [100%]</span>
test_main.py <span style="color: green; white-space: pre;">. [100%]</span>

<span style="color: green;">================= 1 passed in 0.03s =================</span>
```
Expand Down
2 changes: 1 addition & 1 deletion tests/test_completion/test_completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def test_show_completion():
def test_install_completion():
bash_completion_path: Path = Path.home() / ".bash_completion"
text = ""
if bash_completion_path.is_file():
if bash_completion_path.is_file(): # pragma: nocover
text = bash_completion_path.read_text()
result = subprocess.run(
[
Expand Down
4 changes: 2 additions & 2 deletions tests/test_completion/test_completion_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def test_completion_install_fish():
script_path = Path(mod.__file__)
completion_path: Path = Path.home() / f".config/fish/completions/{script_path.name}.fish"
text = ""
if completion_path.is_file():
if completion_path.is_file(): # pragma: nocover
text = completion_path.read_text()
result = subprocess.run(
["coverage", "run", mod.__file__, "--install-completion", "fish"],
Expand Down Expand Up @@ -114,7 +114,7 @@ def test_completion_install_powershell():
completion_path: Path = Path.home() / f".config/powershell/Microsoft.PowerShell_profile.ps1"
completion_path_bytes = f"{completion_path}\n".encode("windows-1252")
text = ""
if completion_path.is_file():
if completion_path.is_file(): # pragma: nocover
text = completion_path.read_text()

with mock.patch.object(
Expand Down

1 comment on commit a89fc4e

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.