Skip to content

v0.4.2 - @test_case Decorator

Latest

Choose a tag to compare

@pr4bh4sh pr4bh4sh released this 07 Dec 22:59
· 6 commits to master since this release

What's New in 0.4.2

Introduced @test_case decorator to easily identify test methods without enforcing naming conventions.

Features

  • @test_case Decorator: Mark any function as a test case using @test_case. This allows expect() to function correctly even if the function name doesn't start with test_.
  • Parallel Testing: CI now runs tests in parallel using pytest-xdist, verifying thread safety of the new features.
  • pytest.ini: Better test discovery support for test.py.

Usage

from delayed_assert import expect, assert_expectations, test_case

@test_case
def verify_custom_scenario():
    expect(1 == 1, "Should pass")

def test_runner():
    verify_custom_scenario()
    assert_expectations()

Improvements

  • Verified zero-dependency installation (no runtime dependency on pytest).
  • Improved internal context management using threading.local.