From 7b8841b2d5bd279bab90cfd7df9684f320cc6f6f Mon Sep 17 00:00:00 2001 From: Adam Ling Date: Tue, 3 Dec 2024 16:45:41 -0800 Subject: [PATCH 1/4] remove unused parameter --- tests/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index f938f7dc8ad..ecfa99444aa 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -58,7 +58,7 @@ def is_excluded_frontend_file(path): return False -def pytest_addoption(parser, pluginmanager): +def pytest_addoption(parser): parser.addoption("--disable_sql_simplifier", action="store_true", default=False) parser.addoption("--disable_cte_optimization", action="store_true", default=False) parser.addoption( From c5c430e89058802d5808061736d63b115bb35fa3 Mon Sep 17 00:00:00 2001 From: Adam Ling Date: Tue, 3 Dec 2024 20:55:53 -0800 Subject: [PATCH 2/4] put at the end --- tests/conftest.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index ecfa99444aa..a38d18888c8 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -58,17 +58,13 @@ def is_excluded_frontend_file(path): return False -def pytest_addoption(parser): +def pytest_addoption(parser, pluginmanager): parser.addoption("--disable_sql_simplifier", action="store_true", default=False) parser.addoption("--disable_cte_optimization", action="store_true", default=False) parser.addoption( "--disable_multithreading_mode", action="store_true", default=False ) parser.addoption("--skip_sql_count_check", action="store_true", default=False) - if not any( - "--local_testing_mode" in opt.names() for opt in parser._anonymous.options - ): - parser.addoption("--local_testing_mode", action="store_true", default=False) parser.addoption("--enable_ast", action="store_true", default=False) parser.addoption("--validate_ast", action="store_true", default=False) parser.addoption( @@ -78,6 +74,10 @@ def pytest_addoption(parser): type=str, help="Path to the Unparser JAR built in the monorepo. To build it, run `sbt assembly` from the unparser directory.", ) + if not any( + "--local_testing_mode" in opt.names() for opt in parser._anonymous.options + ): + parser.addoption("--local_testing_mode", action="store_true", default=False) def pytest_collection_modifyitems(items) -> None: From 53c42406c1ed6de645e6b359372d023dbd7f1a0c Mon Sep 17 00:00:00 2001 From: Adam Ling Date: Wed, 4 Dec 2024 09:23:15 -0800 Subject: [PATCH 3/4] fix option default value --- tests/conftest.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index a38d18888c8..47049d83806 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -65,6 +65,10 @@ def pytest_addoption(parser, pluginmanager): "--disable_multithreading_mode", action="store_true", default=False ) parser.addoption("--skip_sql_count_check", action="store_true", default=False) + if not any( + "--local_testing_mode" in opt.names() for opt in parser._anonymous.options + ): + parser.addoption("--local_testing_mode", action="store_true", default=False) parser.addoption("--enable_ast", action="store_true", default=False) parser.addoption("--validate_ast", action="store_true", default=False) parser.addoption( @@ -74,10 +78,6 @@ def pytest_addoption(parser, pluginmanager): type=str, help="Path to the Unparser JAR built in the monorepo. To build it, run `sbt assembly` from the unparser directory.", ) - if not any( - "--local_testing_mode" in opt.names() for opt in parser._anonymous.options - ): - parser.addoption("--local_testing_mode", action="store_true", default=False) def pytest_collection_modifyitems(items) -> None: @@ -115,7 +115,7 @@ def sql_simplifier_enabled(pytestconfig): @pytest.fixture(scope="session") def local_testing_mode(pytestconfig): - return pytestconfig.getoption("local_testing_mode") + return pytestconfig.getoption("local_testing_mode", False) @pytest.fixture(scope="function") From d0386f4c9371d1a02b62ad40b02685a3d1df4853 Mon Sep 17 00:00:00 2001 From: Adam Ling Date: Wed, 4 Dec 2024 09:27:24 -0800 Subject: [PATCH 4/4] add comment --- tests/conftest.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/conftest.py b/tests/conftest.py index 47049d83806..92abf2e4ab3 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -115,6 +115,7 @@ def sql_simplifier_enabled(pytestconfig): @pytest.fixture(scope="session") def local_testing_mode(pytestconfig): + # SNOW-1845413 we have a default value here unlike other options to bypass test in stored procedure return pytestconfig.getoption("local_testing_mode", False)