File: test_errors.py

package info (click to toggle)
ansible-core 2.20.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 32,760 kB
  • sloc: python: 175,447; cs: 4,929; sh: 4,732; xml: 34; makefile: 21
file content (21 lines) | stat: -rw-r--r-- 492 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from __future__ import annotations

import pytest

from ansible import errors

from units.test_utils.controller.display import emits_warnings


@pytest.mark.parametrize("name", (
    "AnsibleFilterTypeError",
    "_AnsibleActionDone",
))
def test_deprecated(name: str) -> None:
    with emits_warnings(deprecation_pattern='is deprecated'):
        getattr(errors, name)


def test_deprecated_attribute_error() -> None:
    with pytest.raises(AttributeError):
        getattr(errors, 'bogus')