from skimage._shared.utils import all_warnings, skimage_deprecation
from numpy.testing import assert_warns

def import_filter():
    from skimage import filter as F
    assert('sobel' in dir(F))

def test_filter_import():
    with all_warnings():
        assert_warns(skimage_deprecation, import_filter)

from numpy.testing import assert_warns
from warnings import catch_warnings, simplefilter

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

    assert('sobel' in dir(F))

Check for deprecation on import is problematic. Rather just check that filter can be imported normally.
Check for deprecation on import is problematic.  Rather just check that filter can be imported normally.

- from skimage._shared.utils import all_warnings, skimage_deprecation
  from numpy.testing import assert_warns
+ from warnings import catch_warnings, simplefilter
  
- def import_filter():
+ def test_import_filter():
+     with catch_warnings():
+         simplefilter('ignore')
-     from skimage import filter as F
+         from skimage import filter as F
+ 
      assert('sobel' in dir(F))
  
- def test_filter_import():
-     with all_warnings():
-         assert_warns(skimage_deprecation, import_filter)
- 
Check for deprecation on import is problematic. Rather just check that filter can be imported normally.
## Code Before:
from skimage._shared.utils import all_warnings, skimage_deprecation
from numpy.testing import assert_warns

def import_filter():
    from skimage import filter as F
    assert('sobel' in dir(F))

def test_filter_import():
    with all_warnings():
        assert_warns(skimage_deprecation, import_filter)

## Instruction:
Check for deprecation on import is problematic. Rather just check that filter can be imported normally.
## Code After:
from numpy.testing import assert_warns
from warnings import catch_warnings, simplefilter

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

    assert('sobel' in dir(F))
