Skip to content

Commit

Permalink
TST split test parameters using mark.parametrize instead of within th…
Browse files Browse the repository at this point in the history
…e test
  • Loading branch information
eickenberg committed Oct 23, 2023
1 parent 340dec8 commit ff2d6cf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
10 changes: 4 additions & 6 deletions tests/test_t1_forward.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,11 @@ def check_t1_forward(N: int, dim: int, device: str) -> None:
]


@pytest.mark.parametrize("N_and_dim", Ns_and_dims)
def test_t1_forward_CPU(N_and_dim) -> None:
N, dim = N_and_dim
@pytest.mark.parametrize("N, dim", Ns_and_dims)
def test_t1_forward_CPU(N, dim) -> None:
check_t1_forward(N, dim, "cpu")


@pytest.mark.parametrize("N_and_dim", Ns_and_dims)
def test_t1_forward_cuda(N_and_dim) -> None:
N, dim = N_and_dim
@pytest.mark.parametrize("N, dim", Ns_and_dims)
def test_t1_forward_cuda(N, dim) -> None:
check_t1_forward(N, dim, "cuda")
10 changes: 4 additions & 6 deletions tests/test_t2_forward.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,11 @@ def check_t2_forward(N: int, dim: int, device: str, fftshift=False) -> None:
]


@pytest.mark.parametrize("N_and_dim", Ns_and_dims)
def test_t2_forward_CPU(N_and_dim) -> None:
N, dim = N_and_dim
@pytest.mark.parametrize("N, dim", Ns_and_dims)
def test_t2_forward_CPU(N, dim) -> None:
check_t2_forward(N, dim, "cpu")


@pytest.mark.parametrize("N_and_dim", Ns_and_dims)
def test_t2_forward_cuda(N_and_dim) -> None:
N, dim = N_and_dim
@pytest.mark.parametrize("N, dim", Ns_and_dims)
def test_t2_forward_cuda(N, dim) -> None:
check_t2_forward(N, dim, "cuda")

0 comments on commit ff2d6cf

Please sign in to comment.