Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions tests/doc/test_rst.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
functions here to test them.
"""

from pytest import mark


def test_amp():
import torch
Expand Down Expand Up @@ -198,12 +200,13 @@ def test_autogram():
test_autogram()


@mark.filterwarnings(
"ignore::DeprecationWarning", "ignore::lightning.fabric.utilities.warnings.PossibleUserWarning"
)
def test_lightning_integration():
# Extra ----------------------------------------------------------------------------------------
import logging
import warnings

warnings.filterwarnings("ignore")
logging.disable(logging.INFO)
# ----------------------------------------------------------------------------------------------

Expand Down
14 changes: 7 additions & 7 deletions tests/unit/aggregation/test_values.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import warnings

from pytest import mark
from pytest import mark, param
from torch import Tensor, tensor
from torch.testing import assert_close

Expand Down Expand Up @@ -98,7 +96,12 @@
from torchjd.aggregation import NashMTL

AGGREGATOR_PARAMETRIZATIONS.append(
(NashMTL(n_tasks=2), J_base, tensor([0.0542, 0.7061, 0.7061]))
param(
NashMTL(n_tasks=2),
J_base,
tensor([0.0542, 0.7061, 0.7061]),
marks=mark.filterwarnings("ignore::UserWarning"),
)
)

except ImportError:
Expand All @@ -109,9 +112,6 @@
def test_aggregator_output(A: Aggregator, J: Tensor, expected_output: Tensor):
"""Test that the output values of an aggregator are fixed (on cpu)."""

if str(A).startswith("NashMTL"):
warnings.filterwarnings("ignore")

assert_close(A(J), expected_output, rtol=0, atol=1e-4)


Expand Down
Loading