diff --git a/CHANGELOG.md b/CHANGELOG.md index 23d4c72..14e4bff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ All notable changes to this project will be documented in this file. +## [0.6.0] - 2024-08-30 + +### Added + +- `show_locals` parameter to print local variable values after the execution of the function. ## [0.5.1] - 2024-07-07 diff --git a/pyproject.toml b/pyproject.toml index 251a7e5..c4de977 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "pysvt" -version = "0.5.1" +version = "0.6.0" description = "A simple test case runner in Python that uses TOML configurations and decorator syntax." authors = ["dhzdhd "] readme = "README.md" diff --git a/pysvt/__main__.py b/pysvt/__main__.py index 2b54cf0..569e325 100644 --- a/pysvt/__main__.py +++ b/pysvt/__main__.py @@ -11,9 +11,9 @@ from rich.console import Console from pysvt.utils.ctx import Timer -from pysvt.utils.validation import get_result_locals from pysvt.utils.models import Result, _ClsModel, _FuncModel from pysvt.utils.printer import Printer +from pysvt.utils.validation import get_result_locals console = Console() @@ -347,6 +347,8 @@ def _validate(self, data: _FuncModel, func: Callable[..., Any]) -> Result: class inspect_locals: - def __init__(self) -> None: ... + def __init__(self) -> None: + ... - def __call__(self, obj: object) -> Any: ... + def __call__(self, obj: object) -> Any: + ... diff --git a/pysvt/utils/printer.py b/pysvt/utils/printer.py index a752a5d..a83b3fc 100644 --- a/pysvt/utils/printer.py +++ b/pysvt/utils/printer.py @@ -86,7 +86,7 @@ def post_validation( out_str += f"""\n\n{Printer.bold("Stdout")} -\n{res.stdout.strip()}""" if res.local_vars is not None: - out_str += f"\n\n{Printer.bold("Local variables")} -" + out_str += f"""\n\n{Printer.bold("Local variables")} -""" for k, v in res.local_vars.items(): out_str += f"\n {k} - {v}" diff --git a/pysvt/utils/validation.py b/pysvt/utils/validation.py index e0e5c5c..2d5a741 100644 --- a/pysvt/utils/validation.py +++ b/pysvt/utils/validation.py @@ -1,6 +1,6 @@ import sys import types -from typing import Callable, Any +from typing import Any, Callable def get_result_locals(