def pytest_generate_tests(metafunc):
    """Parametrize tests to run on all backends."""

    if 'backend' in metafunc.fixturenames:

        skip_backends = set()
        # Skip backends specified on the module level
        if hasattr(metafunc.module, 'skip_backends'):
            skip_backends = skip_backends.union(
                set(metafunc.module.skip_backends))
        # Skip backends specified on the class level
        if hasattr(metafunc.cls, 'skip_backends'):
            skip_backends = skip_backends.union(
                set(metafunc.cls.skip_backends))

        # Use only backends specified on the command line if any
        if metafunc.config.option.backend:
            backend = set([x.lower() for x in metafunc.config.option.backend])
        # Otherwise use all available backends
        # FIXME: This doesn't really work since the list of backends is
        # dynamically populated as backends are imported
        else:
            backend = set(backends.keys())
        # Restrict to set of backends specified on the module level
        if hasattr(metafunc.module, 'backends'):
            backend = backend.intersection(set(metafunc.module.backends))
        # Restrict to set of backends specified on the class level
        if hasattr(metafunc.cls, 'backends'):
            backend = backend.intersection(set(metafunc.cls.backends))
        # It is preferable to run in greedy mode first, in
        # case some test create leftover computations
        lazy = []
        # Skip greedy execution by passing skip_greedy as a parameter
        if not ('skip_greedy' in metafunc.fixturenames or
                metafunc.config.option.lazy):
            lazy.append('greedy')
        # Skip lazy execution by passing skip_greedy as a parameter
        if not ('skip_lazy' in metafunc.fixturenames or
                metafunc.config.option.greedy):
            lazy.append('lazy')
        # Allow skipping individual backends by passing skip_<backend> as a
        # parameter
        backend = [b for b in backend.difference(skip_backends)
                   if not metafunc.fixturenames in 'skip_' + b]
        params = list(product(backend, lazy))
        metafunc.parametrize('backend', params or [(None, None)], indirect=True,
                             ids=['-'.join(p) for p in params])
dataset/ETHPy150Open OP2/PyOP2/test/conftest.py/pytest_generate_tests/swapped operands of `in`