File: test_vcr_import.py

package info (click to toggle)
python-azure 20230112%2Bgit-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 749,544 kB
  • sloc: python: 6,815,827; javascript: 287; makefile: 195; xml: 109; sh: 105
file content (16 lines) | stat: -rw-r--r-- 396 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import sys


def test_vcr_import_deprecation(recwarn):

    if "vcr" in sys.modules:
        # Remove imported module entry if already loaded in another test
        del sys.modules["vcr"]

    import vcr  # noqa: F401

    if sys.version_info[0] == 2:
        assert len(recwarn) == 1
        assert issubclass(recwarn[0].category, DeprecationWarning)
    else:
        assert len(recwarn) == 0