@@ -450,6 +450,14 @@ def _verify_parallelism_parameters(
450
450
is_flag = True ,
451
451
envvar = "REMOVE_ARM_PACKAGES" ,
452
452
)
453
+ option_force_sa_warnings = click .option (
454
+ "--force-sa-warnings/--no-force-sa-warnings" ,
455
+ help = "Enable `sqlalchemy.exc.MovedIn20Warning` during the tests runs." ,
456
+ is_flag = True ,
457
+ default = True ,
458
+ show_default = True ,
459
+ envvar = "SQLALCHEMY_WARN_20" ,
460
+ )
453
461
454
462
455
463
@group_for_testing .command (
@@ -496,6 +504,7 @@ def _verify_parallelism_parameters(
496
504
@option_verbose
497
505
@option_dry_run
498
506
@option_github_repository
507
+ @option_force_sa_warnings
499
508
@click .argument ("extra_pytest_args" , nargs = - 1 , type = click .UNPROCESSED )
500
509
def command_for_tests (** kwargs ):
501
510
_run_test_command (** kwargs )
@@ -537,6 +546,7 @@ def command_for_tests(**kwargs):
537
546
@option_test_timeout
538
547
@option_upgrade_boto
539
548
@option_use_airflow_version
549
+ @option_force_sa_warnings
540
550
@option_verbose
541
551
def command_for_db_tests (** kwargs ):
542
552
_run_test_command (
@@ -585,6 +595,7 @@ def command_for_db_tests(**kwargs):
585
595
@option_test_timeout
586
596
@option_upgrade_boto
587
597
@option_use_airflow_version
598
+ @option_force_sa_warnings
588
599
@option_verbose
589
600
def command_for_non_db_tests (** kwargs ):
590
601
_run_test_command (
@@ -612,6 +623,7 @@ def _run_test_command(
612
623
enable_coverage : bool ,
613
624
excluded_parallel_test_types : str ,
614
625
extra_pytest_args : tuple ,
626
+ force_sa_warnings : bool ,
615
627
forward_credentials : bool ,
616
628
github_repository : str ,
617
629
image_tag : str | None ,
@@ -654,6 +666,7 @@ def _run_test_command(
654
666
downgrade_sqlalchemy = downgrade_sqlalchemy ,
655
667
downgrade_pendulum = downgrade_pendulum ,
656
668
enable_coverage = enable_coverage ,
669
+ force_sa_warnings = force_sa_warnings ,
657
670
forward_credentials = forward_credentials ,
658
671
forward_ports = False ,
659
672
github_repository = github_repository ,
@@ -745,6 +758,7 @@ def _run_test_command(
745
758
@option_python
746
759
@option_skip_provider_tests
747
760
@option_test_timeout
761
+ @option_force_sa_warnings
748
762
@option_verbose
749
763
@click .argument ("extra_pytest_args" , nargs = - 1 , type = click .UNPROCESSED )
750
764
def integration_tests (
@@ -761,6 +775,7 @@ def integration_tests(
761
775
postgres_version : str ,
762
776
python : str ,
763
777
skip_provider_tests : bool ,
778
+ force_sa_warnings : bool ,
764
779
test_timeout : int ,
765
780
):
766
781
docker_filesystem = get_filesystem_type ("/var/lib/docker" )
@@ -779,6 +794,7 @@ def integration_tests(
779
794
python = python ,
780
795
skip_provider_tests = skip_provider_tests ,
781
796
test_type = "Integration" ,
797
+ force_sa_warnings = force_sa_warnings ,
782
798
)
783
799
fix_ownership_using_docker ()
784
800
cleanup_python_generated_files ()
0 commit comments