Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit test failed #253

Open
binliunls opened this issue Aug 8, 2024 · 0 comments
Open

Unit test failed #253

binliunls opened this issue Aug 8, 2024 · 0 comments

Comments

@binliunls
Copy link

binliunls commented Aug 8, 2024

When I ran the command pytest tests under the CellProfiler-plugins folder, it reported errors shown below. I had already run the pip install -e . and pip install -e .[imagejscript] for dependencies installation before I ran the test. What should I do to make these tests pass?

================================================= test session starts =================================================
platform win32 -- Python 3.8.19, pytest-8.3.2, pluggy-1.5.0
rootdir: C:\software\CellProfiler-plugins
collected 0 items / 1 error

======================================================= ERRORS ========================================================
___________________________________ ERROR collecting tests/test_runimagejscript.py ____________________________________
ImportError while importing test module 'C:\software\CellProfiler-plugins\tests\test_runimagejscript.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
C:\Users\alexliu\Anaconda3\envs\test_plugin\lib\importlib\__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests\test_runimagejscript.py:17: in <module>
    import cellprofiler.modules.runimagejscript
E   ModuleNotFoundError: No module named 'cellprofiler.modules.runimagejscript'
================================================== warnings summary ===================================================
..\..\Users\alexliu\Anaconda3\envs\test_plugin\lib\site-packages\cellprofiler_core\utilities\image.py:11
  C:\Users\alexliu\Anaconda3\envs\test_plugin\lib\site-packages\cellprofiler_core\utilities\image.py:11: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
    import pkg_resources

..\..\Users\alexliu\Anaconda3\envs\test_plugin\lib\site-packages\pkg_resources\__init__.py:3144
  C:\Users\alexliu\Anaconda3\envs\test_plugin\lib\site-packages\pkg_resources\__init__.py:3144: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('mpl_toolkits')`.
  Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
    declare_namespace(pkg)

..\..\Users\alexliu\Anaconda3\envs\test_plugin\lib\site-packages\skimage\util\dtype.py:27
  C:\Users\alexliu\Anaconda3\envs\test_plugin\lib\site-packages\skimage\util\dtype.py:27: DeprecationWarning: `np.bool8` is a deprecated alias for `np.bool_`.  (Deprecated NumPy 1.24)
    np.bool8: (False, True),

..\..\Users\alexliu\Anaconda3\envs\test_plugin\lib\site-packages\skimage\io\collection.py:15
..\..\Users\alexliu\Anaconda3\envs\test_plugin\lib\site-packages\skimage\io\collection.py:15
  C:\Users\alexliu\Anaconda3\envs\test_plugin\lib\site-packages\skimage\io\collection.py:15: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
    if LooseVersion(pil_version) < LooseVersion('7.1.0'):

..\..\Users\alexliu\Anaconda3\envs\test_plugin\lib\site-packages\skimage\restoration\inpaint.py:6
  C:\Users\alexliu\Anaconda3\envs\test_plugin\lib\site-packages\skimage\restoration\inpaint.py:6: DeprecationWarning: Please use `laplace` from the `scipy.ndimage` namespace, the `scipy.ndimage.filters` namespace is deprecated.
    from scipy.ndimage.filters import laplace

..\..\Users\alexliu\Anaconda3\envs\test_plugin\lib\site-packages\skimage\feature\_orb_descriptor_positions.py:8
  C:\Users\alexliu\Anaconda3\envs\test_plugin\lib\site-packages\skimage\feature\_orb_descriptor_positions.py:8: DeprecationWarning: loadtxt(): Parsing an integer via a float is deprecated.  To avoid this warning, you can:
      * make sure the original data is stored as integers.
      * use the `converters=` keyword argument.  If you only use
        NumPy 1.23 or later, `converters=float` will normally work.
      * Use `np.loadtxt(...).astype(np.int64)` parsing the file as
        floating point and then convert it.  (On all NumPy versions.)
    (Deprecated NumPy 1.23)
    POS = np.loadtxt(os.path.join(this_dir, "orb_descriptor_positions.txt"),

..\..\Users\alexliu\Anaconda3\envs\test_plugin\lib\site-packages\skimage\filters\_unsharp_mask.py:2
  C:\Users\alexliu\Anaconda3\envs\test_plugin\lib\site-packages\skimage\filters\_unsharp_mask.py:2: DeprecationWarning: Please use `gaussian_filter` from the `scipy.ndimage` namespace, the `scipy.ndimage.filters` namespace is deprecated.
    from scipy.ndimage.filters import gaussian_filter

..\..\Users\alexliu\Anaconda3\envs\test_plugin\lib\site-packages\skimage\io\_plugins\imageio_plugin.py:10
..\..\Users\alexliu\Anaconda3\envs\test_plugin\lib\site-packages\skimage\io\_plugins\imageio_plugin.py:10
..\..\Users\alexliu\Anaconda3\envs\test_plugin\lib\site-packages\skimage\io\_plugins\imageio_plugin.py:10
  C:\Users\alexliu\Anaconda3\envs\test_plugin\lib\site-packages\skimage\io\_plugins\imageio_plugin.py:10: DeprecationWarning: Starting with ImageIO v3 the behavior of this function will switch to that of iio.v3.imread. To keep the current behavior (and make this warning disappear) use `import imageio.v2 as imageio` or call `imageio.v2.imread` directly.
    return np.asarray(imageio_imread(*args, **kwargs))

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=============================================== short test summary info ===============================================
ERROR tests/test_runimagejscript.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
============================================ 11 warnings, 1 error in 0.55s ============================================

(test_plugin) C:\software\CellProfiler-plugins>pytest tests
================================================= test session starts =================================================
platform win32 -- Python 3.8.19, pytest-8.3.2, pluggy-1.5.0
rootdir: C:\software\CellProfiler-plugins
collected 0 items / 2 errors

======================================================= ERRORS ========================================================
________________________________ ERROR collecting tests/test_histogramequalization.py _________________________________
ImportError while importing test module 'C:\software\CellProfiler-plugins\tests\test_histogramequalization.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
C:\Users\alexliu\Anaconda3\envs\test_plugin\lib\importlib\__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests\test_histogramequalization.py:6: in <module>
    import histogramequalization
E   ModuleNotFoundError: No module named 'histogramequalization'
___________________________________ ERROR collecting tests/test_runimagejscript.py ____________________________________
ImportError while importing test module 'C:\software\CellProfiler-plugins\tests\test_runimagejscript.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
C:\Users\alexliu\Anaconda3\envs\test_plugin\lib\importlib\__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests\test_runimagejscript.py:17: in <module>
    import cellprofiler.modules.runimagejscript
E   ModuleNotFoundError: No module named 'cellprofiler.modules.runimagejscript'
================================================== warnings summary ===================================================
..\..\Users\alexliu\Anaconda3\envs\test_plugin\lib\site-packages\cellprofiler_core\utilities\image.py:11
  C:\Users\alexliu\Anaconda3\envs\test_plugin\lib\site-packages\cellprofiler_core\utilities\image.py:11: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
    import pkg_resources

..\..\Users\alexliu\Anaconda3\envs\test_plugin\lib\site-packages\pkg_resources\__init__.py:3144
  C:\Users\alexliu\Anaconda3\envs\test_plugin\lib\site-packages\pkg_resources\__init__.py:3144: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('mpl_toolkits')`.
  Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
    declare_namespace(pkg)

..\..\Users\alexliu\Anaconda3\envs\test_plugin\lib\site-packages\skimage\util\dtype.py:27
  C:\Users\alexliu\Anaconda3\envs\test_plugin\lib\site-packages\skimage\util\dtype.py:27: DeprecationWarning: `np.bool8` is a deprecated alias for `np.bool_`.  (Deprecated NumPy 1.24)
    np.bool8: (False, True),

..\..\Users\alexliu\Anaconda3\envs\test_plugin\lib\site-packages\skimage\io\collection.py:15
..\..\Users\alexliu\Anaconda3\envs\test_plugin\lib\site-packages\skimage\io\collection.py:15
  C:\Users\alexliu\Anaconda3\envs\test_plugin\lib\site-packages\skimage\io\collection.py:15: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
    if LooseVersion(pil_version) < LooseVersion('7.1.0'):

..\..\Users\alexliu\Anaconda3\envs\test_plugin\lib\site-packages\skimage\restoration\inpaint.py:6
  C:\Users\alexliu\Anaconda3\envs\test_plugin\lib\site-packages\skimage\restoration\inpaint.py:6: DeprecationWarning: Please use `laplace` from the `scipy.ndimage` namespace, the `scipy.ndimage.filters` namespace is deprecated.
    from scipy.ndimage.filters import laplace

..\..\Users\alexliu\Anaconda3\envs\test_plugin\lib\site-packages\skimage\feature\_orb_descriptor_positions.py:8
  C:\Users\alexliu\Anaconda3\envs\test_plugin\lib\site-packages\skimage\feature\_orb_descriptor_positions.py:8: DeprecationWarning: loadtxt(): Parsing an integer via a float is deprecated.  To avoid this warning, you can:
      * make sure the original data is stored as integers.
      * use the `converters=` keyword argument.  If you only use
        NumPy 1.23 or later, `converters=float` will normally work.
      * Use `np.loadtxt(...).astype(np.int64)` parsing the file as
        floating point and then convert it.  (On all NumPy versions.)
    (Deprecated NumPy 1.23)
    POS = np.loadtxt(os.path.join(this_dir, "orb_descriptor_positions.txt"),

..\..\Users\alexliu\Anaconda3\envs\test_plugin\lib\site-packages\skimage\filters\_unsharp_mask.py:2
  C:\Users\alexliu\Anaconda3\envs\test_plugin\lib\site-packages\skimage\filters\_unsharp_mask.py:2: DeprecationWarning: Please use `gaussian_filter` from the `scipy.ndimage` namespace, the `scipy.ndimage.filters` namespace is deprecated.
    from scipy.ndimage.filters import gaussian_filter

..\..\Users\alexliu\Anaconda3\envs\test_plugin\lib\site-packages\skimage\io\_plugins\imageio_plugin.py:10
..\..\Users\alexliu\Anaconda3\envs\test_plugin\lib\site-packages\skimage\io\_plugins\imageio_plugin.py:10
..\..\Users\alexliu\Anaconda3\envs\test_plugin\lib\site-packages\skimage\io\_plugins\imageio_plugin.py:10
  C:\Users\alexliu\Anaconda3\envs\test_plugin\lib\site-packages\skimage\io\_plugins\imageio_plugin.py:10: DeprecationWarning: Starting with ImageIO v3 the behavior of this function will switch to that of iio.v3.imread. To keep the current behavior (and make this warning disappear) use `import imageio.v2 as imageio` or call `imageio.v2.imread` directly.
    return np.asarray(imageio_imread(*args, **kwargs))

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=============================================== short test summary info ===============================================
ERROR tests/test_histogramequalization.py
ERROR tests/test_runimagejscript.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
=========================================== 11 warnings, 2 errors in 0.56s ============================================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant