Skip to main content

A Python test framework, written in Rust.

Project description

Karva (0.0.1-alpha.1)

codecov PyPI - Version

[!NOTE]

Sadly, this will not be very well maintained and should not be used for anything important. I wanted to see if I could make a better pytest. But unless I completely diverge from the current architecture and basically start again, and try to make a better pytest-xdist, the performance of this will not be much better than pytest, let alone pytest-xdist.

Thanks for taking an interest! Perhaps I will have a proper go at this in the future.

A Python test framework, written in Rust.

Benchmark results

About Karva

Karva aims to be an efficient alternative to pytest and unittest.

While we do not yet support all of pytest's features, we aim to gradually add support for pytest alternatives as we add features.

Getting started

Installation

Karva is available as karva on PyPI.

Use karva directly with uvx:

uvx karva test
uvx karva version

Or install karva with uv, or pip:

# With uv.
uv tool install karva@latest

# Add karva to your project.
uv add --dev karva

# With pip.
pip install karva

Usage

By default, Karva will respect your .gitignore files when discovering tests in specified directories.

To run your tests, try any of the following:

# Run all tests.
karva test

# Run tests in a specific directory.
karva test tests/

# Run tests in a specific file.
karva test tests/test_example.py

Example

Here is a small example usage

def test_pass():
    assert True


def test_fail():
    assert False, "This test should fail"


def test_error():
    raise ValueError("This is an error")

Running karva:

uv run karva test tests/

Provides the following output:

test tests.test::test_pass ... ok
test tests.test::test_fail ... FAILED
test tests.test::test_error ... FAILED

diagnostics:

error[test-failure]: Test `test_fail` failed
 --> tests/test.py:5:5
  |
5 | def test_fail():
  |     ^^^^^^^^^
6 |     assert False, "This test should fail"
  |
info: Test failed here
 --> tests/test.py:6:5
  |
5 | def test_fail():
6 |     assert False, "This test should fail"
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
info: Error message: This test should fail

error[test-failure]: Test `test_error` failed
  --> tests/test.py:9:5
   |
 9 | def test_error():
   |     ^^^^^^^^^^
10 |     raise ValueError("This is an error")
   |
info: Test failed here
  --> tests/test.py:10:5
   |
 9 | def test_error():
10 |     raise ValueError("This is an error")
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
info: Error message: This is an error

test result: FAILED. 1 passed; 2 failed; 0 skipped; finished in 8ms

Contributing

Contributions are welcome! See CONTRIBUTING.md for more information.

You can also join us on Discord

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

karva-0.0.1a1.tar.gz (113.5 kB view details)

Uploaded Source

Built Distributions

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

karva-0.0.1a1-cp310-abi3-win_amd64.whl (3.1 MB view details)

Uploaded CPython 3.10+Windows x86-64

karva-0.0.1a1-cp310-abi3-win32.whl (2.8 MB view details)

Uploaded CPython 3.10+Windows x86

karva-0.0.1a1-cp310-abi3-musllinux_1_2_x86_64.whl (3.9 MB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ x86-64

karva-0.0.1a1-cp310-abi3-musllinux_1_2_i686.whl (3.9 MB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ i686

karva-0.0.1a1-cp310-abi3-musllinux_1_2_armv7l.whl (3.7 MB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ ARMv7l

karva-0.0.1a1-cp310-abi3-musllinux_1_2_aarch64.whl (3.8 MB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ ARM64

karva-0.0.1a1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.6 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64

karva-0.0.1a1-cp310-abi3-manylinux_2_17_i686.manylinux2014_i686.whl (3.8 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ i686

karva-0.0.1a1-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (3.5 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARMv7l

karva-0.0.1a1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.6 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

karva-0.0.1a1-cp310-abi3-macosx_11_0_arm64.whl (3.2 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

karva-0.0.1a1-cp310-abi3-macosx_10_12_x86_64.whl (3.3 MB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

Details for the file karva-0.0.1a1.tar.gz.

File metadata

  • Download URL: karva-0.0.1a1.tar.gz
  • Upload date:
  • Size: 113.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.10.2

File hashes

Hashes for karva-0.0.1a1.tar.gz
Algorithm Hash digest
SHA256 be56e58babb60491ce96e8d80c8c09a4de201c7adfea6932cffab5ea9932cbb8
MD5 e018c8ba7c6c69e30b949dfb6860ac93
BLAKE2b-256 3d1662010583f3a0ee3d1c07883536ef3faa5aa90d60170cc82c34898a53d2b8

See more details on using hashes here.

File details

Details for the file karva-0.0.1a1-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: karva-0.0.1a1-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 3.1 MB
  • Tags: CPython 3.10+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.10.2

File hashes

Hashes for karva-0.0.1a1-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 f1e3e442b533cedd90554f1dc7e7d6ea90e3ab54081352b5b31f44bc9d683ae6
MD5 7186f33f412ad6505469e42652a373cd
BLAKE2b-256 82ef56c561be50070d344aba8a812c82aa3d8d15b9a39e6e2579d48d4f10c295

See more details on using hashes here.

File details

Details for the file karva-0.0.1a1-cp310-abi3-win32.whl.

File metadata

  • Download URL: karva-0.0.1a1-cp310-abi3-win32.whl
  • Upload date:
  • Size: 2.8 MB
  • Tags: CPython 3.10+, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.10.2

File hashes

Hashes for karva-0.0.1a1-cp310-abi3-win32.whl
Algorithm Hash digest
SHA256 a009f0de5a4b852045d614b503ede6938bb7547f06229edb3d9bb6237dc58a59
MD5 3214e5b210815ac0f3c1e94ed481b5f1
BLAKE2b-256 83e74f610faca2cc9be436e5cd04589dcfa0c1722f697cad04f77f61d446348d

See more details on using hashes here.

File details

Details for the file karva-0.0.1a1-cp310-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for karva-0.0.1a1-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 2513a40a119053d33976fc9b25a32b96290357db0eb0ee338816df78ea25e29f
MD5 76db66feb5a7aa7c201a043fc80939ce
BLAKE2b-256 6b12409939bf1463797fbd7cd0d6326322b563d880f9d384071f4a701143a46e

See more details on using hashes here.

File details

Details for the file karva-0.0.1a1-cp310-abi3-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for karva-0.0.1a1-cp310-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 da53ae15a3eb41203565877f8dd6289ec1b6890ab3f9176b67c64fa54914f144
MD5 12a4f56f86c24b79a53a84a2e3c86c6d
BLAKE2b-256 30dad356b9dd2d61b0267851590648b57174ca0bfda30f7f62a1fff31b0c0981

See more details on using hashes here.

File details

Details for the file karva-0.0.1a1-cp310-abi3-musllinux_1_2_armv7l.whl.

File metadata

File hashes

Hashes for karva-0.0.1a1-cp310-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 f0e94ecfadc8ae9ac69ef3f3769ae4bf50c486d6074503923a6139a8314491f1
MD5 b29d0659c4ea4d30ae56e2d33354aef2
BLAKE2b-256 ba8de5944c5d2c401b7e485ef0442d6a56f71db938f0a806ebf12f276fb5b924

See more details on using hashes here.

File details

Details for the file karva-0.0.1a1-cp310-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for karva-0.0.1a1-cp310-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 80d4c3529a1984b16b6ec86004fb69dad141a3811c5d393eb2cb13045a5b4bed
MD5 35ea2352b8d0d956b1256501476913aa
BLAKE2b-256 f58849dbad6acc9dfc601aadd30d6bc3ed19569a5beadf409358e73bb1243886

See more details on using hashes here.

File details

Details for the file karva-0.0.1a1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for karva-0.0.1a1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0a2c21a162d3d641f9b7c4ee1c9997cf7661aca7e49b19bdfcd900713c5a88a5
MD5 92a84daaa821d7100ad9b185c5bba8ac
BLAKE2b-256 b97a9645572f44c14b37bc1bd795d7accfd544a398c70427b4cb42ff0ebe37af

See more details on using hashes here.

File details

Details for the file karva-0.0.1a1-cp310-abi3-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for karva-0.0.1a1-cp310-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 7a75d53359a4e9045feefe7dbf462ab6aecb1fbec0cc6266bcedc1262be8dae6
MD5 2fe055cd76a8e6628ff3bfb25693c769
BLAKE2b-256 2727a32f034311ff9492d6861727dbbc62427ada89b0d1b99ff858c4faa10dfd

See more details on using hashes here.

File details

Details for the file karva-0.0.1a1-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for karva-0.0.1a1-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 e77b408bff6c9f0d9244c69f3cc29370962e99e5d9c48ae91be6cf7112e7115e
MD5 2737b741310816b6f0348b6e1b10f3d8
BLAKE2b-256 6489e5fb3019595cffb5ff74d73cb14b76c8135295a15c2185865e9751d9def1

See more details on using hashes here.

File details

Details for the file karva-0.0.1a1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for karva-0.0.1a1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 0e83fc3977d784ac1091647429543ff93a243b67fe14bcaeeb7c86da4eae177c
MD5 48276a7624cc70e9e806eb5dc3cc569d
BLAKE2b-256 dc0e25fc649840c79dc77884e8d7e5a96a1c5cb817b4c9d5b7df2825c45223bf

See more details on using hashes here.

File details

Details for the file karva-0.0.1a1-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for karva-0.0.1a1-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f9ecceae2d995bc29067b47a992df0779f473c0ed6bed54b38dffb3f1e710c66
MD5 b5355669d1e66bbe8bd90f3a8d18a4d3
BLAKE2b-256 fb5d369bde1d6103ffaeedb8c9782623c1244cf273bbbb7f429826fe3321198f

See more details on using hashes here.

File details

Details for the file karva-0.0.1a1-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for karva-0.0.1a1-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 8a15d6981f7e4c681bcee380e3ccc8f0b486f219351285100d96d680bca6147e
MD5 89677502f422ba020faef78da3e6599d
BLAKE2b-256 231506fcab8110a7d3e19b8e4d902ad5285584909e071200fe5a4b374729c302

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