Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dhzdhd/pysvt
A simple test case runner in Python that uses TOML configurations and decorator syntax
https://github.com/dhzdhd/pysvt
Last synced: about 6 hours ago
JSON representation
A simple test case runner in Python that uses TOML configurations and decorator syntax
- Host: GitHub
- URL: https://github.com/dhzdhd/pysvt
- Owner: dhzdhd
- License: mit
- Created: 2023-12-13T16:16:47.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-08-30T14:59:29.000Z (4 months ago)
- Last Synced: 2025-01-03T03:09:04.641Z (8 days ago)
- Language: Python
- Homepage: https://pypi.org/project/pysvt/
- Size: 91.8 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# pysvt
## About
A simple test case runner in Python that takes data in the format of a TOML file or dictionary and uses decorator syntax.
## Installation
`pip install pysvt`
## Upgrade version
`pip install --upgrade pysvt`
## Usage
Check the [examples directory](https://github.com/dhzdhd/pysvt/tree/master/examples) for more elaborate examples.
- Function
Python
```python
from pysvt import test@test(file="")
def function(arg1: int, arg2: int) -> int:
return arg1 + arg2
```TOML
```python
name = ["One and Two", "Two and Three"]
metadata = ["Add to 3", "Add to 5"]
i = [[1, 2], [2, 3]]
o = [3, 5]
```or
```python
[[cases]]
name = "One and Two"
i = [1, 2]
o = 3
metadata = "Add to 3"[[cases]]
name = "Two and Three"
i = [2, 3]
o = 5
metadata = "Add to 5"
```- Input key can be either of - i, in, input, inputs
- Output key can be either of - o, out, output, outputs- Class (if you want to test instance methods)
Python
```python
from pysvt import test# Specify the name of the method as the second argument
@test(file="", "function")
class Solution:
def function(self, arg1: int, arg2: int) -> int:
return arg1 + arg2
```TOML
```python
name = ["One and Two", "Two and Three"]
metadata = ["Add to 3", "Add to 5"]
init = [] # Has to be specified, indicates class constructor arguments
i = [[1, 2], [2, 3]]
o = [3, 5]
```or
```python
[[cases]]
name = "One and Two"
i = [1, 2]
o = 3
metadata = "Add to 3"
init = [] # Has to be specified, indicates class constructor arguments[[cases]]
name = "Two and Three"
i = [2, 3]
o = 5
metadata = "Add to 5"
init = []
```- Input key can be either of - i, in, input, inputs
- Output key can be either of - o, out, output, outputs## Running examples
`poetry run python -m examples.`
## Creating a new release
- Update the version in `pyproject.toml`
- Update `CHANGELOG.md`
- Run local lint/format/tests
- Create new git tag and push