MDAnalysis / MDAnalysisData

Access to data for workshops and extended tests of MDAnalysis.
https://www.mdanalysis.org/MDAnalysisData
BSD 3-Clause "New" or "Revised" License
14 stars 5 forks source link

update tests #76

Closed orbeckst closed 1 year ago

orbeckst commented 1 year ago
codecov[bot] commented 1 year ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (225ec81) 56.06% compared to head (4921450) 56.18%. Report is 1 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #76 +/- ## ========================================== + Coverage 56.06% 56.18% +0.11% ========================================== Files 12 12 Lines 371 372 +1 Branches 51 51 ========================================== + Hits 208 209 +1 Misses 160 160 Partials 3 3 ``` | [Files](https://app.codecov.io/gh/MDAnalysis/MDAnalysisData/pull/76?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=MDAnalysis) | Coverage Δ | | |---|---|---| | [MDAnalysisData/base.py](https://app.codecov.io/gh/MDAnalysis/MDAnalysisData/pull/76?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=MDAnalysis#diff-TURBbmFseXNpc0RhdGEvYmFzZS5weQ==) | `98.33% <100.00%> (+0.02%)` | :arrow_up: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

orbeckst commented 1 year ago

Only works for Python 3.12, at least the way I wrote it. Failures like

=================================== FAILURES ===================================
____________________________ test_read_description _____________________________

    def test_read_description():
>       descr = base._read_description("adk_equilibrium.rst")

MDAnalysisData/tests/test_base.py:48: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
MDAnalysisData/base.py:210: in _read_description
    path = importlib.resources.files(__name__) / description_dir / filename
/opt/hostedtoolcache/Python/3.11.6/x64/lib/python3.11/importlib/resources/_common.py:22: in files
    return from_package(get_package(package))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

package = 'MDAnalysisData.base'

    def get_package(package):
        # type: (Package) -> types.ModuleType
        """Take a package name or module object and return the module.

        Raise an exception if the resolved module is not a package.
        """
        resolved = resolve(package)
        if wrap_spec(resolved).submodule_search_locations is None:
>           raise TypeError(f'{package!r} is not a package')
E           TypeError: 'MDAnalysisData.base' is not a package

/opt/hostedtoolcache/Python/3.11.6/x64/lib/python3.11/importlib/resources/_common.py:55: TypeError
orbeckst commented 1 year ago

(I don't have more time to work on this right now. Help is welcome!)

IAlibay commented 1 year ago

I've opened PR #78 into this PR which has the right fix, I'm not 100% sure the missing __init__.py file matters, but switching from __name__ to MDAnalysisData does.

pep8speaks commented 1 year ago

Hello @orbeckst! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 210:80: E501 line too long (83 > 79 characters)

Line 1:1: W391 blank line at end of file