-
Notifications
You must be signed in to change notification settings - Fork 54
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
Test fixes #1183
Test fixes #1183
Conversation
if sys.version_info < (3, 12): | ||
pytest.skip( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not @pytest.mark.skipif
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to avoid calling the whole file. If the file is called, all unused snapshots related to it will be deleted during snapshot update. This resulted in some vicious circle, in which created snapshots for Python 3.12 test deleted the snapshots for 3.11. And then, recreating ones for 3.11 deleted the 3.12.
Skiping at module level solves this.
pyproject.toml
Outdated
@@ -92,13 +92,15 @@ test-cov = [ | |||
"coverage run --source=snowflake.cli --module pytest -m loaded_modules --snapshot-warn-unused tests/ ", | |||
"coverage report", | |||
] | |||
test-update = ["pytest --snapshot-update"] | |||
|
|||
[tool.hatch.envs.e2e] | |||
template = "e2e" | |||
features = ["development"] | |||
|
|||
[tool.hatch.envs.e2e.scripts] | |||
test = ["pytest -m e2e --snapshot-warn-unused --durations=0"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We wouldn't have obsolete snapshot if not this flag. I'm not sure if we need more commands. Are we 100% this ignoring unused snapshots is what we want? cc @sfc-gh-mraba
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually i added with rather creating than deleting in mind. We didn't have a tool to run --snapshot-update
with different python version. So i also added scripts to other tests, to allow all snapshot creation to be run from hatch
Pre-review checklist
Changes description
snow cortex
help messages