tessl install tessl/pypi-allure-python-commons@2.15.0Contains the API for end users as well as helper functions and classes to build Allure adapters for Python test frameworks
Agent Success
Agent success rate when using this tile
94%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.27x
Baseline
Agent success rate without this tile
74%
Build a test fixture tracking utility that monitors and reports on setup and teardown operations during test execution.
Create a Python module that tracks fixture execution in a test environment. The system should:
The utility should be able to:
@generates
class FixtureTracker:
"""Tracks test fixtures and generates execution reports."""
def start_setup_fixture(self, test_id: str, fixture_name: str) -> str:
"""
Begin tracking a setup (before) fixture.
Args:
test_id: The UUID of the parent test case
fixture_name: The name of the setup fixture
Returns:
A unique fixture UUID for this fixture
"""
pass
def start_teardown_fixture(self, test_id: str, fixture_name: str) -> str:
"""
Begin tracking a teardown (after) fixture.
Args:
test_id: The UUID of the parent test case
fixture_name: The name of the teardown fixture
Returns:
A unique fixture UUID for this fixture
"""
pass
def stop_fixture(self, fixture_id: str, status: str, message: str = None) -> None:
"""
Complete tracking a fixture and record its final status.
Args:
fixture_id: The UUID of the fixture to stop
status: The final status ('passed', 'failed', 'broken')
message: Optional status message or error details
"""
pass
def get_report(self) -> dict:
"""
Generate a summary report of all tracked fixtures.
Returns:
A dictionary containing:
- 'setup_fixtures': list of setup fixture details
- 'teardown_fixtures': list of teardown fixture details
Each fixture should include: fixture_id, test_id, name, status, duration_ms, message
"""
passTest: Create a tracker, start a setup fixture named "database_connection" for test "test-001", stop it with status "passed", and verify it appears in the report with correct details.
Test: Create a tracker, start a teardown fixture named "cleanup_files" for test "test-002", stop it with status "passed", and verify it appears in the report with correct details.
Test: Create a tracker, start two setup fixtures ("setup_db" and "setup_cache") and one teardown fixture ("cleanup_all") all for test "test-003", stop them all with status "passed", and verify all three appear correctly in the report.
Test: Create a tracker, start a setup fixture named "init_service" for test "test-004", stop it with status "failed" and message "Connection timeout", and verify the failure is recorded in the report.
Provides test lifecycle management and fixture tracking capabilities.