Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PytestRemovedIn8Warning ("support for nose tests is deprecated and will be removed in a future release") #84

Merged
merged 1 commit into from
Sep 13, 2024
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
2 changes: 1 addition & 1 deletion tests/test_calibrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class TestCalibrate:
],
)

def setup(self) -> None:
def setup_method(self) -> None:
"""Set up the tests."""
self.true_params = np.array([0.50, 0.50])
self.bounds = [
Expand Down
2 changes: 1 addition & 1 deletion tests/test_losses/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def compute_loss_1d(
sim_data: NDArray[np.float64]
real_data: NDArray[np.float64]

def setup(self) -> None:
def setup_method(self) -> None:
"""Set up the tests."""
self.loss = TestComputeLoss.MyCustomLoss(
self.loss_constant,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_plot/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,6 @@ class BasePlotResultsTest(BasePlotTest):
saving_folder: Path

@classmethod
def setup(cls) -> None:
def setup_method(cls) -> None:
"""Set up the test."""
cls.args = [cls.saving_folder, *cls.args]
2 changes: 1 addition & 1 deletion tests/test_plot/test_plot_descriptive_statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class TestTsStats(BasePlotTest):
args: Sequence[Any] = ()
expected_image = PLOT_DIR / "ts_stats-expected.png"

def setup(self) -> None:
def setup_method(self) -> None:
"""Set up the test."""
rng = np.random.default_rng(42)
data = rng.random(100)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_plot/test_plot_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def test_run_by_method_num(self, method_num: int) -> None:
self.args = [self.saving_folder, method_num]
super().run()

def teardown(self) -> None:
def teardown_method(self) -> None:
"""Tear down the test."""
# restore default attributes
delattr(self, "expected_image")
Expand Down Expand Up @@ -113,7 +113,7 @@ def test_run_by_batch_num(self, batch_num: int) -> None:
self.args = [self.saving_folder, list(range(batch_num))]
super().run()

def teardown(self) -> None:
def teardown_method(self) -> None:
"""Tear down the test."""
# restore default attributes
delattr(self, "expected_image")
Expand Down
2 changes: 1 addition & 1 deletion tests/test_samplers/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def sample_batch(
"""Sample a batch of parameters."""
return self.random_generator.random(size=(batch_size, search_space.dims))

def setup(self) -> None:
def setup_method(self) -> None:
"""Set up the tests."""
self.bounds = [[0.10, 0.10, 0.10], [1.00, 1.00, 1.00]]
self.bounds_step = [0.01, 0.01, 0.01]
Expand Down
2 changes: 1 addition & 1 deletion tests/test_samplers/test_gaussian_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
class TestGaussianProcess2D:
"""Test GaussianProcess sampling."""

def setup(self) -> None:
def setup_method(self) -> None:
"""Set up the test."""
self.xys, self.losses = self._construct_fake_grid(seed=0)

Expand Down
Loading