Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
cli99 committed Feb 2, 2024
1 parent 74c66ce commit fe3dd2c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions tests/callbacks/test_callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ class TestCallbacks:
def setup_class(cls):
pytest.importorskip('wandb', reason='WandB is optional.')

@pytest.mark.filterwarnings('ignore:UserWarningWarning')
@pytest.mark.filterwarnings('ignore::UserWarning')
def test_callback_is_constructable(self, cb_cls: Type[Callback]):
cb_kwargs = get_cb_kwargs(cb_cls)
cb = cb_cls(**cb_kwargs)
assert isinstance(cb_cls, type)
assert isinstance(cb, cb_cls)

@pytest.mark.filterwarnings('ignore:UserWarningWarning')
@pytest.mark.filterwarnings('ignore::UserWarning')
def test_multiple_fit_start_and_end(self, cb_cls: Type[Callback], dummy_state: State):
"""Test that callbacks do not crash when Event.FIT_START and Event.FIT_END is called multiple times."""
cb_kwargs = get_cb_kwargs(cb_cls)
Expand All @@ -71,7 +71,7 @@ def test_multiple_fit_start_and_end(self, cb_cls: Type[Callback], dummy_state: S
engine.run_event(Event.FIT_START)
engine.run_event(Event.FIT_END)

@pytest.mark.filterwarnings('ignore:UserWarningWarning')
@pytest.mark.filterwarnings('ignore::UserWarning')
def test_idempotent_close(self, cb_cls: Type[Callback], dummy_state: State):
"""Test that callbacks do not crash when .close() and .post_close() are called multiple times."""
cb_kwargs = get_cb_kwargs(cb_cls)
Expand All @@ -88,7 +88,7 @@ def test_idempotent_close(self, cb_cls: Type[Callback], dummy_state: State):
engine.close()
engine.close()

@pytest.mark.filterwarnings('ignore:UserWarningWarning')
@pytest.mark.filterwarnings('ignore::UserWarning')
def test_multiple_init_and_close(self, cb_cls: Type[Callback], dummy_state: State):
"""Test that callbacks do not crash when INIT/.close()/.post_close() are called multiple times in that order."""
cb_kwargs = get_cb_kwargs(cb_cls)
Expand Down Expand Up @@ -140,15 +140,15 @@ def _get_trainer(self, cb: Callback, device_train_microbatch_size: int):
torch_prof_memory_filename=None),
)

@pytest.mark.filterwarnings('ignore:UserWarningWarning')
@pytest.mark.filterwarnings('ignore::UserWarning')
def test_trains(self, cb_cls: Type[Callback], device_train_microbatch_size: int, _remote: bool):
del _remote # unused. `_remote` must be passed through to parameterize the test markers.
cb_kwargs = get_cb_kwargs(cb_cls)
cb = cb_cls(**cb_kwargs)
trainer = self._get_trainer(cb, device_train_microbatch_size)
trainer.fit()

@pytest.mark.filterwarnings('ignore:UserWarningWarning')
@pytest.mark.filterwarnings('ignore::UserWarning')
def test_trains_multiple_calls(self, cb_cls: Type[Callback], device_train_microbatch_size: int, _remote: bool):
"""
Tests that training with multiple fits complete.
Expand Down
2 changes: 1 addition & 1 deletion tests/callbacks/test_loggers_across_callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

@pytest.mark.parametrize('logger_cls', get_cbs_and_marks(loggers=True))
@pytest.mark.parametrize('callback_cls', get_cbs_and_marks(callbacks=True))
@pytest.mark.filterwarnings('ignore:UserWarningWarning')
@pytest.mark.filterwarnings('ignore::UserWarning')
def test_loggers_on_callbacks(logger_cls: Type[LoggerDestination], callback_cls: Type[Callback]):
if logger_cls in [ProgressBarLogger, ConsoleLogger, SlackLogger]:
pytest.skip()
Expand Down
2 changes: 1 addition & 1 deletion tests/loggers/test_mosaicml_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def test_format_data_to_json_serializable():

@pytest.mark.parametrize('callback_cls', get_cbs_and_marks(callbacks=True))
@world_size(1, 2)
@pytest.mark.filterwarnings('ignore:UserWarningWarning')
@pytest.mark.filterwarnings('ignore::UserWarning')
def test_logged_data_is_json_serializable(monkeypatch, callback_cls: Type[Callback], world_size):
"""Test that all logged data is json serializable, which is a requirement to use MAPI."""

Expand Down
2 changes: 1 addition & 1 deletion tests/loggers/test_wandb_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def test_wandb_log_metrics(test_wandb_logger):


@pytest.mark.parametrize('callback_cls', get_cbs_and_marks(callbacks=True))
@pytest.mark.filterwarnings('ignore:UserWarningWarning')
@pytest.mark.filterwarnings('ignore::UserWarning')
def test_logged_data_is_json_serializable(callback_cls: Type[Callback]):
"""Test that all logged data is json serializable, which is a requirement to use wandb."""
pytest.importorskip('wandb', reason='wandb is optional')
Expand Down

0 comments on commit fe3dd2c

Please sign in to comment.