diff --git a/python/ipywidgets/ipywidgets/widgets/tests/test_interaction.py b/python/ipywidgets/ipywidgets/widgets/tests/test_interaction.py index 0dc7e5fcfc..feb1afe50c 100644 --- a/python/ipywidgets/ipywidgets/widgets/tests/test_interaction.py +++ b/python/ipywidgets/ipywidgets/widgets/tests/test_interaction.py @@ -19,8 +19,6 @@ # Utility stuff #----------------------------------------------------------------------------- -from .utils import setup, teardown - def f(**kwargs): pass diff --git a/python/ipywidgets/ipywidgets/widgets/tests/test_link.py b/python/ipywidgets/ipywidgets/widgets/tests/test_link.py index 0c92dfdcb2..9301764d40 100644 --- a/python/ipywidgets/ipywidgets/widgets/tests/test_link.py +++ b/python/ipywidgets/ipywidgets/widgets/tests/test_link.py @@ -4,7 +4,6 @@ import pytest from .. import jslink, jsdlink, ToggleButton -from .utils import setup, teardown def test_jslink_args(): with pytest.raises(TypeError): diff --git a/python/ipywidgets/ipywidgets/widgets/tests/test_send_state.py b/python/ipywidgets/ipywidgets/widgets/tests/test_send_state.py index ec18ae4af1..98465b9b7d 100644 --- a/python/ipywidgets/ipywidgets/widgets/tests/test_send_state.py +++ b/python/ipywidgets/ipywidgets/widgets/tests/test_send_state.py @@ -3,7 +3,7 @@ from traitlets import Bool, Tuple, List -from .utils import setup, teardown, DummyComm +from .utils import setup from ..widget import Widget diff --git a/python/ipywidgets/ipywidgets/widgets/tests/test_set_state.py b/python/ipywidgets/ipywidgets/widgets/tests/test_set_state.py index 82ecbd9311..22ec54d90f 100644 --- a/python/ipywidgets/ipywidgets/widgets/tests/test_set_state.py +++ b/python/ipywidgets/ipywidgets/widgets/tests/test_set_state.py @@ -6,7 +6,7 @@ from traitlets import Bool, Tuple, List, Instance, CFloat, CInt, Float, Int, TraitError, observe -from .utils import setup, teardown +from .utils import setup import ipywidgets from ipywidgets import Widget diff --git a/python/ipywidgets/ipywidgets/widgets/tests/utils.py b/python/ipywidgets/ipywidgets/widgets/tests/utils.py index 260485e3f8..8dbbcb355b 100644 --- a/python/ipywidgets/ipywidgets/widgets/tests/utils.py +++ b/python/ipywidgets/ipywidgets/widgets/tests/utils.py @@ -12,7 +12,7 @@ NEW_COMM_PACKAGE = False import ipykernel.comm - +import pytest class DummyComm(): comm_id = 'a-b-c-d' @@ -87,10 +87,10 @@ def teardown_test_comm(): setattr(Widget, attr, value) _widget_attrs.clear() +@pytest.fixture(autouse=True) def setup(): setup_test_comm() - -def teardown(): + yield teardown_test_comm() def call_method(method, *args, **kwargs):