Skip to main content

rust-style test macros

Project description

intest

Rust-like inline tests for Python. Write and run tests right next to your code!

Haven't tested this on large projects, but it provides the amazing feature of rust which is a single file with its tests

Surprised this didn't exist prior

No async, no fixtures, no fancy stuff

Installation

pip install intest

Usage

In your Python files:

from intest.decorators import test, before_each, after_each

def add(a: int, b: int) -> int:
    return a + b

@test
def test_add():
    assert add(2, 2) == 4

@test(tag="math")
def test_add_negative():
    assert add(-2, -2) == -4

Run tests:

# Run all tests in project
intest

# Run specific files
intest file1.py file2.py

# Run tests with specific tag
intest --tag math

# Run tests in specific directory
intest --path /path/to/project

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

intest-0.1.2.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

intest-0.1.2-py3-none-any.whl (2.3 kB view details)

Uploaded Python 3

File details

Details for the file intest-0.1.2.tar.gz.

File metadata

  • Download URL: intest-0.1.2.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.14

File hashes

Hashes for intest-0.1.2.tar.gz
Algorithm Hash digest
SHA256 6dec86925f6b71538445681b1b727fddc3fc284a743b4cae7c6042228d78256a
MD5 6d5eea1cb80b9c9c5abea0b0aeccaef7
BLAKE2b-256 2c67e7c850d8c5c6a1e21358a9b0c61371d59b61eb79c90309ff9a407659c7cb

See more details on using hashes here.

File details

Details for the file intest-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: intest-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 2.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.14

File hashes

Hashes for intest-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 14e518300c0c53e586c12968fd5552fff987b8016737d0a81d17a70d736bbe21
MD5 fed8e27e5bbc5fa6e209c68772f2ad52
BLAKE2b-256 e331b38bfb6090212542b5f69ccfa7e8c46e04a1ea771dc5c0ffeefd80da85b9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page