Skip to content

Commit

Permalink
fix conftest
Browse files Browse the repository at this point in the history
  • Loading branch information
juliagsy committed Jul 26, 2023
1 parent d8b6b9d commit c3e3dd7
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,20 @@

# local
import ivy
import jax

jax.config.update("jax_enable_x64", True)


FW_STRS = ["numpy", "jax", "tensorflow", "torch"]


@pytest.fixture(autouse=True)
def run_around_tests(device, f, compile_graph, fw):
def run_around_tests(device, compile_graph, fw):
if "gpu" in device and fw == "numpy":
# Numpy does not support GPU
pytest.skip()
with f.use:
with ivy.utils.backend.ContextManager(fw):
with ivy.DefaultDevice(device):
yield

Expand Down Expand Up @@ -47,10 +50,8 @@ def pytest_generate_tests(metafunc):
for backend_str in backend_strs:
for device in devices:
for compile_graph in compile_modes:
configs.append(
(device, ivy.with_backend(backend_str), compile_graph, backend_str)
)
metafunc.parametrize("device,f,compile_graph,fw", configs)
configs.append((device, compile_graph, backend_str))
metafunc.parametrize("device,compile_graph,fw", configs)


def pytest_addoption(parser):
Expand Down

0 comments on commit c3e3dd7

Please sign in to comment.