-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
deprecations.buffer: respect --quiet and --warn-error-options for dep…
…recations (#10534)
- Loading branch information
1 parent
8622360
commit 1dd26e7
Showing
6 changed files
with
107 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
kind: Fixes | ||
body: respect --quiet and --warn-error-options for flag deprecations | ||
time: 2024-08-06T19:48:43.399453-04:00 | ||
custom: | ||
Author: michelleark | ||
Issue: "10105" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import pytest | ||
|
||
import dbt.deprecations as deprecations | ||
|
||
|
||
@pytest.fixture(scope="function") | ||
def active_deprecations(): | ||
assert not deprecations.active_deprecations | ||
|
||
yield deprecations.active_deprecations | ||
|
||
deprecations.reset_deprecations() | ||
|
||
|
||
@pytest.fixture(scope="function") | ||
def buffered_deprecations(): | ||
assert not deprecations.buffered_deprecations | ||
|
||
yield deprecations.buffered_deprecations | ||
|
||
deprecations.buffered_deprecations.clear() | ||
|
||
|
||
def test_buffer_deprecation(active_deprecations, buffered_deprecations): | ||
deprecations.buffer("project-flags-moved") | ||
|
||
assert active_deprecations == set() | ||
assert len(buffered_deprecations) == 1 | ||
|
||
|
||
def test_fire_buffered_deprecations(active_deprecations, buffered_deprecations): | ||
deprecations.buffer("project-flags-moved") | ||
deprecations.fire_buffered_deprecations() | ||
|
||
assert active_deprecations == set(["project-flags-moved"]) | ||
assert len(buffered_deprecations) == 0 |