Skip to content

Commit

Permalink
Fix compatibility with pytest 8 (#14413)
Browse files Browse the repository at this point in the history
setup/teardown nose methods are no longer supported by pytest 8.
https://docs.pytest.org/en/latest/deprecations.html#setup-teardown
  • Loading branch information
Carreau authored Apr 26, 2024
2 parents f476dd7 + cdacafd commit f68c737
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions IPython/core/tests/test_pylabtools.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def init_history(self):
def enable_gui(self, gui):
pass

def setup(self):
def setup_method(self):
import matplotlib
def act_mpl(backend):
matplotlib.rcParams['backend'] = backend
Expand All @@ -184,7 +184,7 @@ def act_mpl(backend):
self._save_cis = backend_inline.configure_inline_support
backend_inline.configure_inline_support = lambda *a, **kw: None

def teardown(self):
def teardown_method(self):
pt.activate_matplotlib = self._save_am
pt.import_pylab = self._save_ip
backend_inline.configure_inline_support = self._save_cis
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ qtconsole = [
]
terminal = []
test = [
"pytest<8",
"pytest",
"pytest-asyncio<0.22",
"testpath",
"pickleshare",
Expand Down

0 comments on commit f68c737

Please sign in to comment.