def test_next(): stream = TokenStream(iter(TEST_STREAM)) for exp in TEST_STREAM: eq_(exp.as_tuple(), stream.current.as_tuple()) stream.next() assert_equal(stream.current.type, 'eof') # test `TokenStream.eof` as well assert_true(stream.eof)