Skip to content

Commit

Permalink
Remove deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
rossant committed Sep 7, 2021
1 parent 6ffe05a commit ebc63a9
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 24 deletions.
4 changes: 2 additions & 2 deletions phy/cluster/tests/test_supervisor.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#from contextlib import contextmanager

from pytest import yield_fixture, fixture
from pytest import fixture, fixture
import numpy as np
from numpy.testing import assert_array_equal as ae

Expand All @@ -34,7 +34,7 @@ def handler(msg_type, msg_log_context, msg_string):
# Fixtures
#------------------------------------------------------------------------------

@yield_fixture
@fixture
def gui(tempdir, qtbot):
# NOTE: mock patch show box exec_
_supervisor._show_box = lambda _: _
Expand Down
4 changes: 2 additions & 2 deletions phy/cluster/views/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Imports
#------------------------------------------------------------------------------

from pytest import yield_fixture
from pytest import fixture

from phy.gui import GUI

Expand All @@ -15,7 +15,7 @@
# Utilities and fixtures
#------------------------------------------------------------------------------

@yield_fixture
@fixture
def gui(tempdir, qtbot):
gui = GUI(position=(200, 200), size=(800, 600), config_dir=tempdir)
gui.set_default_actions()
Expand Down
8 changes: 4 additions & 4 deletions phy/gui/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Imports
#------------------------------------------------------------------------------

from pytest import yield_fixture
from pytest import fixture

from ..actions import Actions, Snippets
from ..gui import GUI
Expand All @@ -16,7 +16,7 @@
# Utilities and fixtures
#------------------------------------------------------------------------------

@yield_fixture
@fixture
def gui(tempdir, qtbot):
gui = GUI(position=(200, 100), size=(100, 100), config_dir=tempdir)
gui.set_default_actions()
Expand All @@ -28,11 +28,11 @@ def gui(tempdir, qtbot):
del gui


@yield_fixture
@fixture
def actions(gui):
yield Actions(gui, name='actions')


@yield_fixture
@fixture
def snippets(gui):
yield Snippets(gui)
4 changes: 2 additions & 2 deletions phy/gui/tests/test_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from functools import partial
from pathlib import Path
from pytest import yield_fixture, mark
from pytest import fixture, mark

from phylib.utils import connect, unconnect
from phylib.utils.testing import captured_logging
Expand Down Expand Up @@ -37,7 +37,7 @@ def _wait_until_table_ready(qtbot, table):
b.wait()


@yield_fixture
@fixture
def table(qtbot):
columns = ["id", "count"]
data = [{"id": i,
Expand Down
4 changes: 2 additions & 2 deletions phy/plot/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Imports
#------------------------------------------------------------------------------

from pytest import fixture, yield_fixture
from pytest import fixture, fixture

from ..base import BaseCanvas
from ..panzoom import PanZoom
Expand All @@ -16,7 +16,7 @@
# Utilities and fixtures
#------------------------------------------------------------------------------

@yield_fixture
@fixture
def canvas(qapp, qtbot):
c = BaseCanvas()
yield c
Expand Down
8 changes: 4 additions & 4 deletions phy/plot/tests/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import logging

import numpy as np
from pytest import yield_fixture
from pytest import fixture

from ..base import BaseVisual, GLSLInserter, gloo
from ..transform import (subplot_bounds, Translate, Scale, Range,
Expand All @@ -25,7 +25,7 @@
# Fixtures
#------------------------------------------------------------------------------

@yield_fixture
@fixture
def vertex_shader_nohook():
yield """
attribute vec2 a_position;
Expand All @@ -35,7 +35,7 @@ def vertex_shader_nohook():
"""


@yield_fixture
@fixture
def vertex_shader():
yield """
attribute vec2 a_position;
Expand All @@ -46,7 +46,7 @@ def vertex_shader():
"""


@yield_fixture
@fixture
def fragment_shader():
yield """
void main() {
Expand Down
4 changes: 2 additions & 2 deletions phy/plot/tests/test_panzoom.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import os

from numpy.testing import assert_allclose as ac
from pytest import yield_fixture
from pytest import fixture

from . import mouse_drag, key_press
from ..base import BaseVisual
Expand All @@ -34,7 +34,7 @@ def set_data(self):
self.emit_visual_set_data()


@yield_fixture
@fixture
def panzoom(qtbot, canvas_pz):
c = canvas_pz
visual = MyTestVisual()
Expand Down
4 changes: 2 additions & 2 deletions phy/utils/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
# Imports
#------------------------------------------------------------------------------

from pytest import yield_fixture
from pytest import fixture


#------------------------------------------------------------------------------
# Common fixtures
#------------------------------------------------------------------------------

@yield_fixture
@fixture
def temp_config_dir(tempdir):
"""NOTE: the user directory should be loaded with:
Expand Down
4 changes: 2 additions & 2 deletions phy/utils/tests/test_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import numpy as np
from numpy.testing import assert_array_equal as ae
from pytest import fixture, yield_fixture
from pytest import fixture, fixture

from phylib.io.array import write_array, read_array
from ..context import Context, _fullname
Expand All @@ -26,7 +26,7 @@ def context(tempdir):
return ctx


@yield_fixture
@fixture
def temp_phy_config_dir(tempdir):
"""Use a temporary phy user directory."""
import phy.utils.context
Expand Down
4 changes: 2 additions & 2 deletions phy/utils/tests/test_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from textwrap import dedent

from pytest import yield_fixture, raises
from pytest import fixture, raises

from ..plugin import (IPluginRegistry,
IPlugin,
Expand All @@ -24,7 +24,7 @@
# Fixtures
#------------------------------------------------------------------------------

@yield_fixture
@fixture
def no_native_plugins():
# Save the plugins.
plugins = IPluginRegistry.plugins
Expand Down

0 comments on commit ebc63a9

Please sign in to comment.