Skip to content

Commit

Permalink
Update docs and improve printing
Browse files Browse the repository at this point in the history
  • Loading branch information
dhzdhd committed Jun 6, 2024
1 parent 9f15e21 commit caf7d4b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions pysvt/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ class test:
- `postprocess` (Callable[..., Any] or None): A function to postprocess the test outputs. Default is None.
- `error_only` (bool): Flag indicating whether to display only the failed test cases. Default is False.
- `is_live` (bool): Flag indicating whether to run the tests in live mode. Default is False.
- `pretty_print_errors` (bool): Flag indicating whether to pretty print errors with colors and more information. Default is True.
- `redirect_stdout` (bool): Flag indicating whether to redirect all stdout (print statements, etc) to the pretty printed panels. Default is True.
Raises:
- `ValueError`: If the `file` argument is not of type str or Path or `method` argument is not provided for instance methods.
Expand All @@ -48,6 +50,14 @@ def function(arg1, arg2):
class Demo:
def method(self, arg1, arg2):
# Your code
data = {
"i": [[1, 2], [2, 3]],
"o": [2, 3],
}
@test(data=data)
def function(arg1, arg2):
# Your code
```
"""

Expand Down
4 changes: 2 additions & 2 deletions pysvt/utils/printer.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ def post_validation_normal(
"""
out_str = f"Input - {data.inputs}\nExpected output - {data.output}\nActual output - {res.data}"

if res.stdout is not None:
out_str += f"\n\nStdout -\n{res.stdout}"
if res.stdout is not None and res.stdout.strip() != "":
out_str += f"\n\nStdout -\n{res.stdout.strip()}"

emoji = ":white_check_mark:" if res.valid else ":cross_mark:"
time_str = (
Expand Down

0 comments on commit caf7d4b

Please sign in to comment.