MCPcopy Create free account
hub / github.com/apify/crawlee-python / test_multiple_marks

Function test_multiple_marks

tests/unit/sessions/test_session.py:67–80  ·  view source on GitHub ↗

Test the mark_good and mark_bad methods in sequence.

(session: Session)

Source from the content-addressed store, hash-verified

65
66
67def test_multiple_marks(session: Session) -> None:
68 """Test the mark_good and mark_bad methods in sequence."""
69 initial_usage_count = session.usage_count
70 session.mark_bad()
71 session.mark_bad()
72 assert session.error_score == initial_usage_count + 2
73 session.mark_good()
74 session.mark_good()
75 assert session.error_score == initial_usage_count + 1
76 session.mark_bad()
77 session.mark_bad()
78 session.mark_good()
79 assert session.is_blocked
80 assert not session.is_usable
81
82
83def test_retire_method(session: Session) -> None:

Callers

nothing calls this directly

Calls 2

mark_badMethod · 0.80
mark_goodMethod · 0.80

Tested by

no test coverage detected