mirror of
https://github.com/saltstack/salt.git
synced 2025-04-16 09:40:20 +00:00

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.
8 lines
389 B
Python
8 lines
389 B
Python
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
|
|
)
|