Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_stream_depending_on_self_is_error(self, stream_id, exclusive):
"""
Inserting a stream that is dependent on itself is rejected.
"""
p = priority.PriorityTree()
with pytest.raises(priority.PriorityLoop):
p.insert_stream(
stream_id=stream_id, depends_on=stream_id, exclusive=exclusive
)