test
0.1.0Fixtures, assertions and a runner for Edge Python tests.
edge add test && edge lock
sha256-a2101fa8d40862c187b67251c6ba97a650db7dfadb7da2276f23efc6dd4feda9
test
test is a unit-test harness written in Edge Python. Tests register with decorators, fixtures are injected by keyword, and run() reports each test and exits with a code a runner can read.
pass. user has a name pass. division by zero raises 2 passed, 0 failed
@fixture registers a factory under its function’s name. Every test that names it gets a fresh one, so no test leaks state into another. @test(description, *uses) registers a test and the fixtures it takes.
raises(exc_type, match=None) asserts that the block raises exc_type, a class or a tuple of classes. With match the message must also contain that text, so the right exception raised for the wrong reason still fails.
pass. rejects negatives 1 passed, 0 failed
run() prints a pass., fail. or error. line per test and a summary, then raises SystemExit(1) if anything failed and SystemExit(0) otherwise. A failed assertion carries its message.
pass. two plus two fail. this one fails (AssertionError: letter missing) 1 passed, 1 failed
edge test finds every *_test.py file and reads each verdict from that exit code.