-
-
Notifications
You must be signed in to change notification settings - Fork 699
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a test case for
typer.enable_rich(<bool>)
Also, add a paragraph to the documentation.
- Loading branch information
1 parent
6a4ba06
commit 67fad4b
Showing
3 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import typer | ||
|
||
typer.enable_rich(False) | ||
|
||
app = typer.Typer() | ||
|
||
|
||
@app.command() | ||
def main(arg: str): # pragma: no cover | ||
pass | ||
|
||
|
||
if __name__ == "__main__": | ||
app() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import subprocess | ||
import sys | ||
from pathlib import Path | ||
|
||
|
||
def test_custom_prog_name(): | ||
file_path = Path(__file__).parent / "assets/enable_rich.py" | ||
result = subprocess.run( | ||
[sys.executable, "-m", "coverage", "run", str(file_path), "--help"], | ||
stdout=subprocess.PIPE, | ||
stderr=subprocess.PIPE, | ||
encoding="utf-8", | ||
) | ||
assert "Arguments:" in result.stdout # as opposed to 'Arguments' without ':' | ||
# like in the Rich Panels |