@@ -316,7 +316,6 @@ def models(self):
316316 "models.yml" : invalid_deprecation_date_yaml ,
317317 }
318318
319- @mock .patch .dict (os .environ , {"DBT_ENV_PRIVATE_RUN_JSONSCHEMA_VALIDATIONS" : "True" })
320319 def test_deprecated_invalid_deprecation_date (self , project ):
321320 event_catcher = EventCatcher (GenericJSONSchemaValidationDeprecation )
322321 note_catcher = EventCatcher (Note )
@@ -362,7 +361,6 @@ def models(self):
362361 }
363362
364363 @mock .patch ("dbt.jsonschemas.jsonschemas._JSONSCHEMA_SUPPORTED_ADAPTERS" , {"postgres" })
365- @mock .patch .dict (os .environ , {"DBT_ENV_PRIVATE_RUN_JSONSCHEMA_VALIDATIONS" : "True" })
366364 def test_custom_key_in_config_deprecation (self , project ):
367365 event_catcher = EventCatcher (CustomKeyInConfigDeprecation )
368366 run_dbt (
@@ -384,7 +382,6 @@ def models(self):
384382 }
385383
386384 @mock .patch ("dbt.jsonschemas.jsonschemas._JSONSCHEMA_SUPPORTED_ADAPTERS" , {"postgres" })
387- @mock .patch .dict (os .environ , {"DBT_ENV_PRIVATE_RUN_JSONSCHEMA_VALIDATIONS" : "True" })
388385 def test_custom_key_in_config_sql_deprecation (self , project ):
389386 event_catcher = EventCatcher (CustomKeyInConfigDeprecation )
390387 run_dbt (
@@ -415,7 +412,6 @@ def models(self):
415412 }
416413
417414 @mock .patch ("dbt.jsonschemas.jsonschemas._JSONSCHEMA_SUPPORTED_ADAPTERS" , {"postgres" })
418- @mock .patch .dict (os .environ , {"DBT_ENV_PRIVATE_RUN_JSONSCHEMA_VALIDATIONS" : "True" })
419415 def test_multiple_custom_keys_in_config_deprecation (self , project ):
420416 event_catcher = EventCatcher (CustomKeyInConfigDeprecation )
421417 run_dbt (
@@ -442,7 +438,6 @@ def models(self):
442438 }
443439
444440 @mock .patch ("dbt.jsonschemas.jsonschemas._JSONSCHEMA_SUPPORTED_ADAPTERS" , {"postgres" })
445- @mock .patch .dict (os .environ , {"DBT_ENV_PRIVATE_RUN_JSONSCHEMA_VALIDATIONS" : "True" })
446441 def test_custom_key_in_object_deprecation (self , project ):
447442 event_catcher = EventCatcher (CustomKeyInObjectDeprecation )
448443 run_dbt (["parse" , "--no-partial-parse" ], callbacks = [event_catcher .catch ])
@@ -486,7 +481,6 @@ def test_jsonschema_validation_deprecations_arent_run_without_env_var(
486481
487482
488483class TestHappyPathProjectHasNoDeprecations :
489- @mock .patch .dict (os .environ , {"DBT_ENV_PRIVATE_RUN_JSONSCHEMA_VALIDATIONS" : "True" })
490484 @mock .patch ("dbt.jsonschemas.jsonschemas._JSONSCHEMA_SUPPORTED_ADAPTERS" , {"postgres" })
491485 def test_happy_path_project_has_no_deprecations (self , happy_path_project ):
492486 event_cathcer = EventCatcher (DeprecationsSummary )
@@ -498,7 +492,6 @@ def test_happy_path_project_has_no_deprecations(self, happy_path_project):
498492
499493
500494class TestBaseProjectHasNoDeprecations :
501- @mock .patch .dict (os .environ , {"DBT_ENV_PRIVATE_RUN_JSONSCHEMA_VALIDATIONS" : "True" })
502495 @mock .patch ("dbt.jsonschemas.jsonschemas._JSONSCHEMA_SUPPORTED_ADAPTERS" , {"postgres" })
503496 def test_base_project_has_no_deprecations (self , project ):
504497 event_cathcer = EventCatcher (DeprecationsSummary )
@@ -707,7 +700,6 @@ class TestMissingPlusPrefixDeprecation:
707700 def project_config_update (self ):
708701 return {"seeds" : {"path" : {"enabled" : True }}}
709702
710- @mock .patch .dict (os .environ , {"DBT_ENV_PRIVATE_RUN_JSONSCHEMA_VALIDATIONS" : "True" })
711703 @mock .patch ("dbt.jsonschemas.jsonschemas._JSONSCHEMA_SUPPORTED_ADAPTERS" , {"postgres" })
712704 def test_missing_plus_prefix_deprecation (self , project ):
713705 event_catcher = EventCatcher (MissingPlusPrefixDeprecation )
@@ -721,7 +713,6 @@ class TestMissingPlusPrefixDeprecationSubPath:
721713 def project_config_update (self ):
722714 return {"seeds" : {"path" : {"+enabled" : True , "sub_path" : {"enabled" : True }}}}
723715
724- @mock .patch .dict (os .environ , {"DBT_ENV_PRIVATE_RUN_JSONSCHEMA_VALIDATIONS" : "True" })
725716 @mock .patch ("dbt.jsonschemas.jsonschemas._JSONSCHEMA_SUPPORTED_ADAPTERS" , {"postgres" })
726717 def test_missing_plus_prefix_deprecation_sub_path (self , project ):
727718 event_catcher = EventCatcher (MissingPlusPrefixDeprecation )
@@ -735,7 +726,6 @@ class TestMissingPlusPrefixDeprecationCustomConfig:
735726 def project_config_update (self ):
736727 return {"seeds" : {"path" : {"custom_config" : True , "sub_path" : {"+enabled" : True }}}}
737728
738- @mock .patch .dict (os .environ , {"DBT_ENV_PRIVATE_RUN_JSONSCHEMA_VALIDATIONS" : "True" })
739729 @mock .patch ("dbt.jsonschemas.jsonschemas._JSONSCHEMA_SUPPORTED_ADAPTERS" , {"postgres" })
740730 def test_missing_plus_prefix_deprecation_sub_path (self , project ):
741731 event_catcher = EventCatcher (MissingPlusPrefixDeprecation )
@@ -749,7 +739,6 @@ class TestCustomConfigInDbtProjectYmlNoDeprecation:
749739 def project_config_update (self ):
750740 return {"seeds" : {"path" : {"+custom_config" : True }}}
751741
752- @mock .patch .dict (os .environ , {"DBT_ENV_PRIVATE_RUN_JSONSCHEMA_VALIDATIONS" : "True" })
753742 @mock .patch ("dbt.jsonschemas.jsonschemas._JSONSCHEMA_SUPPORTED_ADAPTERS" , {"postgres" })
754743 def test_missing_plus_prefix_deprecation_sub_path (self , project ):
755744 note_catcher = EventCatcher (Note )
@@ -782,10 +771,6 @@ def test_jsonschema_validation_gating(
782771 dbt_private_run_jsonschema_validations : bool ,
783772 expected_events : int ,
784773 ) -> None :
785- mocker .patch .dict (
786- os .environ ,
787- {"DBT_ENV_PRIVATE_RUN_JSONSCHEMA_VALIDATIONS" : dbt_private_run_jsonschema_validations },
788- )
789774
790775 if postgres_is_valid :
791776 supported_adapters_with_postgres = {
@@ -911,7 +896,6 @@ def models(self):
911896 "models.yml" : property_moved_to_config_yaml ,
912897 }
913898
914- @mock .patch .dict (os .environ , {"DBT_ENV_PRIVATE_RUN_JSONSCHEMA_VALIDATIONS" : "True" })
915899 @mock .patch ("dbt.jsonschemas.jsonschemas._JSONSCHEMA_SUPPORTED_ADAPTERS" , {"postgres" })
916900 def test_property_moved_to_config_deprecation (self , project ):
917901 event_catcher = EventCatcher (PropertyMovedToConfigDeprecation )
0 commit comments