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

Add query parsing unit tests #3672

Merged
merged 2 commits into from
Apr 27, 2023
Merged

Conversation

dev2049
Copy link
Contributor

@dev2049 dev2049 commented Apr 27, 2023

No description provided.

@dev2049 dev2049 requested a review from eyurtsev April 27, 2023 20:10
Copy link
Collaborator

@eyurtsev eyurtsev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking great!



def test_parse_string_value() -> None:
for x in ('""', '" "', '"foo"', "'foo'"):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it's possible to add extra information after the `assert actual == x[1:-1], details message' , so if one of the tests fails it's easy to determine which test- case it is? (or use pytest.mark.parameterize which does that)



def test_parse_bool_value() -> None:
for y in ("true", "false"):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(style) this is definitely a matter of style, i tend to hard-code the constants for all the test-cases instead of relying on code, to keep the specification of the inputs into the test case as simple as possible

@dev2049 dev2049 merged commit b807a11 into master Apr 27, 2023
@dev2049 dev2049 deleted the dev2049/query_constructor_tests branch April 27, 2023 20:42
vowelparrot pushed a commit that referenced this pull request Apr 28, 2023
samching pushed a commit to samching/langchain that referenced this pull request May 1, 2023
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.

2 participants