Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset lark package in test_parsing.py #596

Merged
merged 1 commit into from
Feb 2, 2024

Conversation

lapp0
Copy link
Collaborator

@lapp0 lapp0 commented Jan 29, 2024

Fixes #595

test_grammars.py fails if test_parsing.py is run first. This results in tests failing in #539

This changeset ensures that test_parsing.py is isolated and doesn't impact other tests.

Previously running the tests would impact lark.lark.LarkOptions._defaults (A class variable, not an instance variable), now the impact is erased via importlib.reload(lark.lark)

@lapp0 lapp0 changed the title Fix test_parsing.py Affecting State of Lark Fix test_parsing.py Affecting Global State, Breaking Tests Jan 29, 2024
@brandonwillard brandonwillard marked this pull request as draft January 30, 2024 14:51
@brandonwillard
Copy link
Contributor

Please make your PR titles a description of the changes and/or what's technically being addressed.

@brandonwillard brandonwillard changed the title Fix test_parsing.py Affecting Global State, Breaking Tests Reset lark package in test_parsing.py Jan 30, 2024
@lapp0
Copy link
Collaborator Author

lapp0 commented Jan 30, 2024

Please make your PR titles a description of the changes and/or what's technically being addressed.

Done!

@lapp0 lapp0 marked this pull request as ready for review January 30, 2024 20:37
@rlouf rlouf merged commit b6ff4fc into outlines-dev:main Feb 2, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

test_grammars.py Failing Due to test_parsing.py
3 participants