File: test_generator_stats.py

package info (click to toggle)
python-drf-spectacular 0.28.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,748 kB
  • sloc: python: 14,174; javascript: 114; sh: 61; makefile: 30
file content (18 lines) | stat: -rw-r--r-- 397 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import inspect

import pytest

from drf_spectacular.drainage import GENERATOR_STATS


def test_known_attribute_access_succeeds():
    assert hasattr(GENERATOR_STATS, 'silent')


def test_unknown_attribute_access_fails():
    with pytest.raises(AttributeError):
        getattr(GENERATOR_STATS, '__spam__')


def test_inspect_unwrap():
    assert inspect.unwrap(GENERATOR_STATS) is GENERATOR_STATS