from warnings import catch_warnings, simplefilter


def test_filter_import():
    with catch_warnings():
        simplefilter('ignore')
        from skimage import filter as F

    assert('sobel' in dir(F))
    assert any(['has been renamed' in w
                for (w, _, _) in F.__warningregistry__]), F.__warningregistry__

from warnings import catch_warnings, simplefilter


def test_filter_import():
    with catch_warnings():
        simplefilter('always')
        from skimage import filter as F

    assert('sobel' in dir(F))
    assert any(['has been renamed' in w
                for (w, _, _) in F.__warningregistry__])

Make sure warning is raised upon import
Make sure warning is raised upon import

  from warnings import catch_warnings, simplefilter
  
  
  def test_filter_import():
      with catch_warnings():
-         simplefilter('ignore')
+         simplefilter('always')
          from skimage import filter as F
  
      assert('sobel' in dir(F))
      assert any(['has been renamed' in w
-                 for (w, _, _) in F.__warningregistry__]), F.__warningregistry__
+                 for (w, _, _) in F.__warningregistry__])
  
Make sure warning is raised upon import
## Code Before:
from warnings import catch_warnings, simplefilter


def test_filter_import():
    with catch_warnings():
        simplefilter('ignore')
        from skimage import filter as F

    assert('sobel' in dir(F))
    assert any(['has been renamed' in w
                for (w, _, _) in F.__warningregistry__]), F.__warningregistry__

## Instruction:
Make sure warning is raised upon import
## Code After:
from warnings import catch_warnings, simplefilter


def test_filter_import():
    with catch_warnings():
        simplefilter('always')
        from skimage import filter as F

    assert('sobel' in dir(F))
    assert any(['has been renamed' in w
                for (w, _, _) in F.__warningregistry__])
