File: test_internal.py

package info (click to toggle)
pytest-flask 1.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 280 kB
  • sloc: python: 553; makefile: 161; sh: 5
file content (15 lines) | stat: -rw-r--r-- 411 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import pytest

from pytest_flask._internal import deprecated


class TestInternal:
    def test_deprecation_decorator(self, appdir):
        @deprecated(reason="testing decorator")
        def deprecated_fun():
            pass

        with pytest.warns(DeprecationWarning) as record:
            deprecated_fun()
        assert len(record) == 1
        assert record[0].message.args[0] == "testing decorator"