Skip to content

Using return instead of assert in starfish/core/spots/FindSpots/test/test_spot_detection.py #2067

Description

@shachafl

Description

Trying to fix a warning rising when using pytest before it turns into an error. Specifically, the use of return instead of assert in two places in starfish/core/spots/FindSpots/test/test_spot_detection.py.
Solution is to use spots.count_total_spots() == ? and put a fixed number instead of '?'

Steps/Code to Reproduce

make fast-test

Expected Results

No warning is thrown.

Actual Results

starfish/core/spots/FindSpots/test/test_spot_detection.py::test_spot_detection_with_image_with_labeled_axes
/home/shachafl/Code/starfish/.venv3.9/lib/python3.9/site-packages/_pytest/python.py:163: PytestReturnNotNoneWarning: Expected None, but starfish/core/spots/FindSpots/test/test_spot_detection.py::test_spot_detection_with_image_with_labeled_axes returned <starfish.core.types._spot_finding_results.SpotFindingResults object at 0x7f6b3dd2dcd0>, which will be an error in a future version of pytest. Did you mean to use assert instead of return?
warnings.warn(

starfish/core/spots/FindSpots/test/test_spot_detection.py::test_reference_image_spot_detection_with_image_with_labeled_axes
/home/shachafl/Code/starfish/.venv3.9/lib/python3.9/site-packages/_pytest/python.py:163: PytestReturnNotNoneWarning: Expected None, but starfish/core/spots/FindSpots/test/test_spot_detection.py::test_reference_image_spot_detection_with_image_with_labeled_axes returned <starfish.core.types._spot_finding_results.SpotFindingResults object at 0x7f076f021af0>, which will be an error in a future version of pytest. Did you mean to use assert instead of return?
warnings.warn(

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugAn issue with an existing feature

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions