-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
fdd8f6d
commit d43461b
Showing
8 changed files
with
133 additions
and
8 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
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,14 @@ | ||
import pytest | ||
|
||
from prefect._internal.compatibility.deprecated import PrefectDeprecationWarning | ||
from prefect.agent import PrefectAgent | ||
|
||
|
||
def test_agent_emits_deprecation_warning(): | ||
with pytest.warns( | ||
PrefectDeprecationWarning, | ||
match=( | ||
"prefect.agent.PrefectAgent has been deprecated. It will not be available after Sep 2024. Use a worker instead. Refer to the upgrade guide for more information" | ||
), | ||
): | ||
PrefectAgent() |
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,22 @@ | ||
""" | ||
Fixture to ignore our own deprecation warnings. | ||
Deprecations should be specifically tested to ensure they are emitted as expected. | ||
""" | ||
|
||
import warnings | ||
|
||
import pytest | ||
|
||
from prefect._internal.compatibility.deprecated import PrefectDeprecationWarning | ||
|
||
|
||
@pytest.fixture(autouse=True) | ||
def ignore_prefect_deprecation_warnings(): | ||
""" | ||
Ignore deprecation warnings from the agent module to avoid | ||
test failures. | ||
""" | ||
with warnings.catch_warnings(): | ||
warnings.simplefilter("ignore", category=PrefectDeprecationWarning) | ||
yield |