Skip to content

Commit

Permalink
fix test_parsing.py affecting state of Lark
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Lapp authored and rlouf committed Feb 2, 2024
1 parent 667701f commit b6ff4fc
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/fsm/test_parsing.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import importlib
from copy import copy

import lark.lark
import pytest
from lark.indenter import DedentError
from lark.lexer import UnexpectedCharacters, UnexpectedToken
Expand Down Expand Up @@ -134,6 +136,9 @@ def test_partial_parsing():
assert len(parser_state.state_stack) == 4
assert parser_state.value_stack[-1].type == "LPAR"

# Clean up lark.lark.LarkOptions._defaults
importlib.reload(lark.lark)


def test_sequential_parse_example():
input_tokens = [
Expand Down Expand Up @@ -195,3 +200,6 @@ def test_sequential_parse_example():

if i + 1 == len(input_tokens):
assert all(tk in next_vocab for tk in ["\n", "\nde", " ", " + 1"])

# Clean up lark.lark.LarkOptions._defaults
importlib.reload(lark.lark)

0 comments on commit b6ff4fc

Please sign in to comment.