-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rather than just rely on the test suite, we also add a deprecation warning to the test module, which will enable a simple method for ensuring that DeprecationWarnings are correctly emitted.
- Loading branch information
Showing
3 changed files
with
34 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 @@ | ||
Added deprecation_warning test state for ensuring that deprecation warnings are correctly emitted. |
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,8 @@ | ||
def test_deprecation_warning_emits_deprecation_warnings(salt_call_cli): | ||
ret = salt_call_cli.run("test.deprecation_warning") | ||
assert ret.stderr.count("DeprecationWarning") >= 2 | ||
assert "This is a test deprecation warning by version." in ret.stderr | ||
assert ( | ||
"This is a test deprecation warning by date very far into the future (3000-01-01)" | ||
in ret.stderr | ||
) |