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

Mark Tests That Generate SQL-Engine-Specific Snapshots #828

Merged
merged 4 commits into from
Oct 30, 2023

Conversation

plypaul
Copy link
Contributor

@plypaul plypaul commented Oct 30, 2023

Description

This PR adds a custom pytest marker to mark tests that generate SQL-engine-specific snapshots. This helps to ensures that the generate_snapshots.py script generates snapshots for all relevant tests.

@cla-bot cla-bot bot added the cla:yes label Oct 30, 2023
@plypaul plypaul requested review from tlento and courtneyholcomb and removed request for tlento October 30, 2023 21:26
@plypaul plypaul marked this pull request as ready for review October 30, 2023 21:26
Copy link
Contributor

@courtneyholcomb courtneyholcomb left a comment

Choose a reason for hiding this comment

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

🚀

Copy link
Contributor

@tlento tlento left a comment

Choose a reason for hiding this comment

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

@plypaul hah, I was way too lazy to make all those mark test changes. 😁

@@ -136,6 +136,7 @@ def convert_and_check(
)


@pytest.mark.sql_engine_snapshot
Copy link
Contributor

Choose a reason for hiding this comment

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

You can mark the file, actually, but this seems fine to me.

@@ -261,6 +261,9 @@ def assert_object_snapshot_equal( # type: ignore[misc]
sql_client: Optional[SqlClient] = None,
) -> None:
"""For tests to compare large objects, this can be used to snapshot a text representation of the object."""
if sql_client is not None:
check_sql_engine_snapshot_marker(request)
Copy link
Contributor

Choose a reason for hiding this comment

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

YES!

@plypaul plypaul merged commit 0a6b559 into main Oct 30, 2023
33 checks passed
@plypaul plypaul deleted the plypaul--60--mark-snapshot branch October 30, 2023 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants