1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16import 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 if sys.version_info[0] == 2: assert len(recwarn) == 1 assert issubclass(recwarn[0].category, DeprecationWarning) else: assert len(recwarn) == 0