Skip to content

Commit

Permalink
fixup! fixup! fixup! fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-turbaszek committed Jul 8, 2024
1 parent 449ae11 commit 26669f0
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ select = [
]

[tool.pytest.ini_options]
addopts = "-vv -m 'not integration and not performance and not e2e and not spcs and not loaded_modules and not integration_experimental'"
addopts = "-vv --maxfail=10 -m 'not integration and not performance and not e2e and not spcs and not loaded_modules and not integration_experimental'"
markers = [
"integration: mark test as integration test",
"performance: mark test as performance test",
Expand Down
8 changes: 6 additions & 2 deletions tests/nativeapp/codegen/snowpark/test_python_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,9 @@ def test_process_no_collected_functions(
write_to_sql=False, # For testing
)

assert_dir_snapshot(project.deploy_root.relative_to(local_path), custom_snapshot)
assert_dir_snapshot(
project.deploy_root.relative_to(local_path), custom_snapshot
)


@mock.patch(
Expand Down Expand Up @@ -401,7 +403,9 @@ def test_process_with_collected_functions(
processor_mapping=processor_mapping,
)

assert_dir_snapshot(project.deploy_root.relative_to(local_path), custom_snapshot)
assert_dir_snapshot(
project.deploy_root.relative_to(local_path), custom_snapshot
)


@pytest.mark.parametrize(
Expand Down
4 changes: 2 additions & 2 deletions tests/nativeapp/test_teardown_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,7 @@ def test_drop_application_cascade(
expected_cascade,
temp_dir,
capsys,
snapshot,
custom_snapshot,
):
if isinstance(application_objects, Exception):
mock_get_objects_owned_by_application.side_effect = application_objects
Expand Down Expand Up @@ -1108,4 +1108,4 @@ def test_drop_application_cascade(
cascade=expected_cascade,
)
stdout, _ = capsys.readouterr()
assert stdout == snapshot
assert stdout == custom_snapshot
16 changes: 8 additions & 8 deletions tests/test_help_messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,34 +62,34 @@ def _iter_through_commands(command, path):
iter_through_all_commands(),
ids=(".".join(cmd) for cmd in iter_through_all_commands()),
)
def test_help_messages(runner, custom_snapshot, command):
def test_help_messages(runner, snapshot, command):
"""
Check help messages against the snapshot
"""
result = runner.invoke(command + ["--help"])
assert result.exit_code == 0
assert result.output == custom_snapshot
assert result.output == snapshot


@pytest.mark.parametrize(
"command",
iter_through_all_commands(command_groups_only=True),
ids=(".".join(cmd) for cmd in iter_through_all_commands(command_groups_only=True)),
)
def test_help_messages_no_help_flag(runner, custom_snapshot, command):
def test_help_messages_no_help_flag(runner, snapshot, command):
"""
Check help messages against the snapshot
"""
result = runner.invoke(command)
assert result.exit_code == 0
assert result.output == custom_snapshot
assert result.output == snapshot


@pytest.mark.skipif(
sys.version_info < PYTHON_3_12,
reason="It tests if cortex search command is hidden when run using Python 3.12",
)
def test_cortex_help_messages_for_312(runner, custom_snapshot):
def test_cortex_help_messages_for_312(runner):
result = runner.invoke(["cortex", "--help"])
assert result.exit_code == 0
assert SNOW_CORTEX_HELP in result.output
Expand All @@ -101,7 +101,7 @@ def test_cortex_help_messages_for_312(runner, custom_snapshot):
sys.version_info < PYTHON_3_12,
reason="It tests if cortex search command is hidden when run using Python 3.12",
)
def test_cortex_help_messages_for_312_no_help_flag(runner, custom_snapshot):
def test_cortex_help_messages_for_312_no_help_flag(runner):
result = runner.invoke(["cortex"])
assert result.exit_code == 0
assert SNOW_CORTEX_HELP in result.output
Expand All @@ -113,7 +113,7 @@ def test_cortex_help_messages_for_312_no_help_flag(runner, custom_snapshot):
sys.version_info >= PYTHON_3_12,
reason="Snow Cortex Search should be only visible in Python version 3.11 and older",
)
def test_cortex_help_messages_for_311_and_less(runner, custom_snapshot):
def test_cortex_help_messages_for_311_and_less(runner):
result = runner.invoke(["cortex", "--help"])
assert result.exit_code == 0
assert SNOW_CORTEX_HELP in result.output
Expand All @@ -125,7 +125,7 @@ def test_cortex_help_messages_for_311_and_less(runner, custom_snapshot):
sys.version_info >= PYTHON_3_12,
reason="Snow Cortex Search should be only visible in Python version 3.11 and older",
)
def test_cortex_help_messages_for_311_and_less_no_help_flag(runner, custom_snapshot):
def test_cortex_help_messages_for_311_and_less_no_help_flag(runner):
result = runner.invoke(["cortex"])
assert result.exit_code == 0
assert SNOW_CORTEX_HELP in result.output
Expand Down

0 comments on commit 26669f0

Please sign in to comment.