Skip to main content

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 for more elaborate examples.

  • Function

    Python

    from pysvt import test
    
    @test(file="<path_to_TOML_file>")
    def function(arg1: int, arg2: int) -> int:
        return arg1 + arg2
    

    TOML

    name = ["One and Two", "Two and Three"]
    metadata = ["Add to 3", "Add to 5"]
    i = [[1, 2], [2, 3]]
    o = [3, 5]
    

    or

    [[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

    from pysvt import test
    
    # Specify the name of the method as the second argument
    @test(file="<path_to_TOML_file>", "function")
    class Solution:
        def function(self, arg1: int, arg2: int) -> int:
            return arg1 + arg2
    

    TOML

    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

    [[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.<example_file_name>

Creating a new release

  • Update the version in pyproject.toml
  • Update CHANGELOG.md
  • Run local lint/format/tests
  • Create new git tag and push

Release files for pysvt 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pysvt 0.6.0
File Size Uploaded
pysvt-0.6.0.tar.gz 8.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pysvt 0.6.0
File Interpreter ABI Platform
pysvt-0.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 17.3 kB

Release files / pysvt-0.6.0.tar.gz

Download URL pysvt-0.6.0.tar.gz
Size 8.2 kB
Tags Source
SHA-256 checksum
How to use checksums
56733fa5001e4f8b63779a30430c2fe667b39ee1feba25c674deb265bc867435
BLAKE2b-256 checksum
How to use checksums
7c47bf85fced0d9f94cf2ed197a04898623b477142e8d2ae96cfba207b69a422
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.2 Windows/11

Release files / pysvt-0.6.0-py3-none-any.whl

Download URL pysvt-0.6.0-py3-none-any.whl
Size 9.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a0fec01cdefb314eebf70ef081d8895ee2c5d085327dede22e24a7d3625276b4
BLAKE2b-256 checksum
How to use checksums
f47862b22d2d6a24158115453efbbb556541a92b0cb2595b996ca7a45df2e8c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.2 Windows/11

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.3

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page