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

Bug: Pytest fails during test collection when there is an error in test_DeepProfiler_processing.py #304

Closed
kenibrewer opened this issue Jul 6, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@kenibrewer
Copy link
Member

kenibrewer commented Jul 6, 2023

Example code with output

(pycytominer-py3.10) @kenibrewer ➜ /workspaces/pycytominer (feature/setup-pyproject-toml) $ pytest
===================================================================== test session starts =====================================================================
platform linux -- Python 3.10.12, pytest-7.4.0, pluggy-1.2.0
rootdir: /workspaces/pycytominer
configfile: pyproject.toml
testpaths: tests
collected 147 items                                                                                                                                           

tests/test_aggregate.py .........                                                                                                                       [  6%]
tests/test_annotate.py ....                                                                                                                             [  8%]
tests/test_consensus.py ..                                                                                                                              [ 10%]
tests/test_feature_select.py .........                                                                                                                  [ 16%]
tests/test_normalize.py ...........                                                                                                                     [ 23%]
tests/test_cyto_utils/test_DeepProfiler_processing.py Terminated

Issue description

Pytest was originally failing during test collection. Deleting test files in groups finally let me isolate tests/test_cyto_utils/test_DeepProfiler_processing.py as the problematic file (Permalink). A substantial amount of processing for DeepProfiler occurs outside of functions. When an error is encountered during these functions pytest fails during test collection with no informative error messages.

Expected behavior

Pytest should report errors that are encountered while preparing data package to run tests for py

Additional information

It was suggested by @d33bs here that the code for generating the deepprofiler python package should be moved into a pytest fixture.

@kenibrewer kenibrewer added the bug Something isn't working label Jul 6, 2023
kenibrewer added a commit to kenibrewer/pycytominer that referenced this issue Jul 6, 2023
@kenibrewer kenibrewer changed the title Bug: DeepProfiler test failure (possibly due to compute resources) Bug: DeepProfiler tests fail on machines with limited resources Aug 5, 2023
@kenibrewer kenibrewer changed the title Bug: DeepProfiler tests fail on machines with limited resources Bug: Pytest fails during test collection when there is an error in test_DeepProfiler_processing.py Aug 5, 2023
@kenibrewer
Copy link
Member Author

I have updated this issue to represent the fact that there are two bugs that need to be dealt with separately. One for the fact that pytest fails during test collection. And another issue for the use of an large dataset for testing purposes that crashes on smaller machines.

d33bs pushed a commit that referenced this issue Aug 18, 2023
* Adjusted postCreateCommand for poetry

* Refactored to put processing in function #304

* Fixed test paths

* Adjusted workflows for poetry

* Add pytest-cov to dependencies

* Fixed python version in workflows

* Fixed action version

* Changed to new default branch name

* Added Python .gitignore template content

* Removed poetry export precommit hook

* Added master back to workflows to allow pipelines to run during transition

* Changed global variables to all caps

* Removed poetry-lock precommit hook

* Changed poetry setup to match postCreateCommand.sh

* Changed paths and files to more inclusive naming

* Renamed test data paths

* Update CITATION.cff and version

* Updated collate to use sqlite3 module not CLI

* Updated poetry.lock

* Adjust test_DeepProfiler to use fixtures

* Documentation updates for poetry

* Fixed misconfigured assertions #314

* Rename python-app.yml to pytest.yml

* Added pytest-cov for cli arg support

* Update author list

* Add sqlite connection/cursor closing

* Add connection.close() to collate

---------

Co-authored-by: Ken Brewer <ken@kenbrewer.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant