-
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.
- Loading branch information
1 parent
0694fd1
commit fdcb0b1
Showing
1 changed file
with
36 additions
and
0 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,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 |