salt/tests/pytests/integration/modules/test_test.py
Wayne Werner 51f561065c Add tests for deprecation warnings
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.
2023-01-10 12:53:49 -07:00

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
)