def test_pop(): state = State(stack=[1, 2]) state.pop() assert state.stack == [1]
def test_pop_empty_stack(): state = State() with pytest.raises(exc.StackError): state.pop()