Skip to content

Issue Module Import py.test #86

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

Open
oliveralka opened this issue Jul 15, 2020 · 0 comments
Open

Issue Module Import py.test #86

oliveralka opened this issue Jul 15, 2020 · 0 comments

Comments

@oliveralka
Copy link
Contributor

I stumbled over an issue that the tests running by py.test, would not be able to import modules - I am actually not sure why.
After removing the __init__.py from the tests directory, all modules could be imported without any issues.

I just wanted to report it, if anyone else runs into the same issue.

py.test ./tests

python 3.8
MacOS 15.5.5

before removing:

============================================================================================================================ ERRORS =============================================================================================================================
_________________________________________________________________________________________________________ ERROR collecting tests/test_data_handling.py __________________________________________________________________________________________________________
ImportError while importing test module '/Users/alka/Documents/work/software/pyprophet_test/pyprophet/tests/test_data_handling.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
tests/test_data_handling.py:4: in <module>
    from pyprophet.data_handling import check_for_unique_blocks
pyprophet/data_handling.py:9: in <module>
    from .optimized import find_top_ranked, rank
pyprophet/optimized.py:1: in <module>
    from ._optimized import *
E   ModuleNotFoundError: No module named 'pyprophet._optimized'
______________________________________________________________________________________________________________ ERROR collecting tests/test_ipf.py _______________________________________________________________________________________________________________
ImportError while importing test module '/Users/alka/Documents/work/software/pyprophet_test/pyprophet/tests/test_ipf.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
tests/test_ipf.py:4: in <module>
    from pyprophet.ipf import prepare_precursor_bm, prepare_transition_bm, apply_bm, compute_model_fdr
pyprophet/ipf.py:9: in <module>
    from .data_handling import check_sqlite_table
pyprophet/data_handling.py:9: in <module>
    from .optimized import find_top_ranked, rank
pyprophet/optimized.py:1: in <module>
    from ._optimized import *
E   ModuleNotFoundError: No module named 'pyprophet._optimized'
___________________________________________________________________________________________________________ ERROR collecting tests/test_optimized.py ____________________________________________________________________________________________________________
ImportError while importing test module '/Users/alka/Documents/work/software/pyprophet_test/pyprophet/tests/test_optimized.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
tests/test_optimized.py:2: in <module>
    import pyprophet.optimized as o
pyprophet/optimized.py:1: in <module>
    from ._optimized import *
E   ModuleNotFoundError: No module named 'pyprophet._optimized'
_________________________________________________________________________________________________________ ERROR collecting tests/test_pyprophet_ipf.py __________________________________________________________________________________________________________
ImportError while importing test module '/Users/alka/Documents/work/software/pyprophet_test/pyprophet/tests/test_pyprophet_ipf.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
tests/test_pyprophet_ipf.py:13: in <module>
    from pyprophet.ipf import read_pyp_peakgroup_precursor
pyprophet/ipf.py:9: in <module>
    from .data_handling import check_sqlite_table
pyprophet/data_handling.py:9: in <module>
    from .optimized import find_top_ranked, rank
pyprophet/optimized.py:1: in <module>
    from ._optimized import *
E   ModuleNotFoundError: No module named 'pyprophet._optimized'
________________________________________________________________________________________________________ ERROR collecting tests/test_pyprophet_score.py _________________________________________________________________________________________________________
ImportError while importing test module '/Users/alka/Documents/work/software/pyprophet_test/pyprophet/tests/test_pyprophet_score.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
tests/test_pyprophet_score.py:13: in <module>
    from pyprophet.ipf import read_pyp_peakgroup_precursor
pyprophet/ipf.py:9: in <module>
    from .data_handling import check_sqlite_table
pyprophet/data_handling.py:9: in <module>
    from .optimized import find_top_ranked, rank
pyprophet/optimized.py:1: in <module>
    from ._optimized import *
E   ModuleNotFoundError: No module named 'pyprophet._optimized'
_____________________________________________________________________________________________________________ ERROR collecting tests/test_stats.py ______________________________________________________________________________________________________________
ImportError while importing test module '/Users/alka/Documents/work/software/pyprophet_test/pyprophet/tests/test_stats.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
tests/test_stats.py:4: in <module>
    from pyprophet.stats import to_one_dim_array, pnorm, pemp, pi0est, qvalue, bw_nrd0, lfdr, stat_metrics
pyprophet/stats.py:12: in <module>
    from .optimized import (find_nearest_matches as _find_nearest_matches,
pyprophet/optimized.py:1: in <module>
    from ._optimized import *
E   ModuleNotFoundError: No module named 'pyprophet._optimized'
==================================================================================================================== short test summary info ====================================================================================================================
ERROR tests/test_data_handling.py
ERROR tests/test_ipf.py
ERROR tests/test_optimized.py
ERROR tests/test_pyprophet_ipf.py
ERROR tests/test_pyprophet_score.py
ERROR tests/test_stats.py

after removing:

platform darwin -- Python 3.8.0, pytest-5.4.3, py-1.9.0, pluggy-0.13.1
rootdir: /Users/alka/Documents/work/software/pyprophet_test/pyprophet
plugins: regtest-1.4.4
collected 53 items                                                                                                                                                                                                                                              

tests/test_data_handling.py ..                                                                                                                                                                                                                            [  3%]
tests/test_ipf.py ....                                                                                                                                                                                                                                    [ 11%]
tests/test_optimized.py .....                                                                                                                                                                                                                             [ 20%]
tests/test_pyprophet_export.py ..........                                                                                                                                                                                                                 [ 39%]
tests/test_pyprophet_ipf.py .....                                                                                                                                                                                                                         [ 49%]
tests/test_pyprophet_levels_contexts.py ..                                                                                                                                                                                                                [ 52%]
tests/test_pyprophet_score.py .................                                                                                                                                                                                                           [ 84%]
tests/test_stats.py ........                                                                                                                                                                                                                              [100%]

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