File: loads3

package info (click to toggle)
python-deprecation 2.1.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 188 kB
  • sloc: python: 451; makefile: 15
file content (19 lines) | stat: -rw-r--r-- 439 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/python3

import deprecation

@deprecation.deprecated(deprecated_in="1.0", current_version="2.0")
def _deprecated_method():
    return "ok"

def test_DeprecatedWarning_doesnt_fail():
    @deprecation.fail_if_not_removed
    def fn():
        _deprecated_method()

    try:
        fn()
    except AssertionError as error:
        raise error("A DeprecatedWarning shouldn't cause a failure")

test_DeprecatedWarning_doesnt_fail()