import pytest

from fuzz_lightyear.datastore import _ALL_POST_FUZZ_HOOKS_BY_OPERATION
from fuzz_lightyear.datastore import _ALL_POST_FUZZ_HOOKS_BY_TAG
from fuzz_lightyear.datastore import _RERUN_POST_FUZZ_HOOKS_BY_OPERATION
from fuzz_lightyear.datastore import _RERUN_POST_FUZZ_HOOKS_BY_TAG
from fuzz_lightyear.datastore import get_excluded_operations
from fuzz_lightyear.datastore import get_included_tags
from fuzz_lightyear.datastore import get_non_vulnerable_operations
from fuzz_lightyear.datastore import get_user_defined_mapping
from fuzz_lightyear.plugins import get_enabled_plugins
from fuzz_lightyear.request import get_victim_session_factory
from fuzz_lightyear.supplements.abstraction import get_abstraction


@pytest.fixture(autouse=True)
def clear_caches():
    get_abstraction.cache_clear()
    get_user_defined_mapping.cache_clear()
    get_enabled_plugins.cache_clear()
    get_victim_session_factory.cache_clear()
    get_excluded_operations.cache_clear()
    get_non_vulnerable_operations.cache_clear()
    get_included_tags.cache_clear()

    _ALL_POST_FUZZ_HOOKS_BY_OPERATION.clear()
    _ALL_POST_FUZZ_HOOKS_BY_TAG.clear()
    _RERUN_POST_FUZZ_HOOKS_BY_OPERATION.clear()
    _RERUN_POST_FUZZ_HOOKS_BY_TAG.clear()


@pytest.fixture(autouse=True)
def ignore_hypothesis_non_interactive_example_warning():
    """In theory we're not supposed to use hypothesis'
    strategy.example(), but fuzz-lightyear isn't using
    hypothesis in a normal way.
    """
    import warnings
    from hypothesis.errors import NonInteractiveExampleWarning
    warnings.filterwarnings(
        'ignore',
        category=NonInteractiveExampleWarning,
    )

[((16, 1, 16, 29), 'pytest.fixture', 'pytest.fixture', (), '', False, 'import pytest\n'), ((32, 1, 32, 29), 'pytest.fixture', 'pytest.fixture', (), '', False, 'import pytest\n'), ((18, 4, 18, 33), 'fuzz_lightyear.supplements.abstraction.get_abstraction.cache_clear', 'get_abstraction.cache_clear', ({}, {}), '()', False, 'from fuzz_lightyear.supplements.abstraction import get_abstraction\n'), ((19, 4, 19, 42), 'fuzz_lightyear.datastore.get_user_defined_mapping.cache_clear', 'get_user_defined_mapping.cache_clear', ({}, {}), '()', False, 'from fuzz_lightyear.datastore import get_user_defined_mapping\n'), ((20, 4, 20, 37), 'fuzz_lightyear.plugins.get_enabled_plugins.cache_clear', 'get_enabled_plugins.cache_clear', ({}, {}), '()', False, 'from fuzz_lightyear.plugins import get_enabled_plugins\n'), ((21, 4, 21, 44), 'fuzz_lightyear.request.get_victim_session_factory.cache_clear', 'get_victim_session_factory.cache_clear', ({}, {}), '()', False, 'from fuzz_lightyear.request import get_victim_session_factory\n'), ((22, 4, 22, 41), 'fuzz_lightyear.datastore.get_excluded_operations.cache_clear', 'get_excluded_operations.cache_clear', ({}, {}), '()', False, 'from fuzz_lightyear.datastore import get_excluded_operations\n'), ((23, 4, 23, 47), 'fuzz_lightyear.datastore.get_non_vulnerable_operations.cache_clear', 'get_non_vulnerable_operations.cache_clear', ({}, {}), '()', False, 'from fuzz_lightyear.datastore import get_non_vulnerable_operations\n'), ((24, 4, 24, 35), 'fuzz_lightyear.datastore.get_included_tags.cache_clear', 'get_included_tags.cache_clear', ({}, {}), '()', False, 'from fuzz_lightyear.datastore import get_included_tags\n'), ((26, 4, 26, 45), 'fuzz_lightyear.datastore._ALL_POST_FUZZ_HOOKS_BY_OPERATION.clear', '_ALL_POST_FUZZ_HOOKS_BY_OPERATION.clear', ({}, {}), '()', False, 'from fuzz_lightyear.datastore import _ALL_POST_FUZZ_HOOKS_BY_OPERATION\n'), ((27, 4, 27, 39), 'fuzz_lightyear.datastore._ALL_POST_FUZZ_HOOKS_BY_TAG.clear', '_ALL_POST_FUZZ_HOOKS_BY_TAG.clear', ({}, {}), '()', False, 'from fuzz_lightyear.datastore import _ALL_POST_FUZZ_HOOKS_BY_TAG\n'), ((28, 4, 28, 47), 'fuzz_lightyear.datastore._RERUN_POST_FUZZ_HOOKS_BY_OPERATION.clear', '_RERUN_POST_FUZZ_HOOKS_BY_OPERATION.clear', ({}, {}), '()', False, 'from fuzz_lightyear.datastore import _RERUN_POST_FUZZ_HOOKS_BY_OPERATION\n'), ((29, 4, 29, 41), 'fuzz_lightyear.datastore._RERUN_POST_FUZZ_HOOKS_BY_TAG.clear', '_RERUN_POST_FUZZ_HOOKS_BY_TAG.clear', ({}, {}), '()', False, 'from fuzz_lightyear.datastore import _RERUN_POST_FUZZ_HOOKS_BY_TAG\n'), ((40, 4, 43, 5), 'warnings.filterwarnings', 'warnings.filterwarnings', (), '', False, 'import warnings\n')]