How to use the priority.PriorityLoop function in priority

To help you get started, we’ve selected a few priority examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github python-hyper / priority / test / test_priority.py View on Github external
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
            )