ioos / compliance-checker

Python tool to check your datasets against compliance standards
http://ioos.github.io/compliance-checker/
Apache License 2.0
104 stars 56 forks source link

Some pytest fixes #1056

Closed jcermauwedu closed 2 months ago

jcermauwedu commented 3 months ago

For the SOS test in test_protocols.py, I set that to skip. I searched for awhile for a working SOS service.

Looking forward to seeing https://github.com/ioos/compliance-checker/pull/1039 merged.

jcermauwedu commented 3 months ago

pre-commit.ci autofix

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 75.00000% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 82.06%. Comparing base (c137e28) to head (b06e777). Report is 14 commits behind head on develop.

Files Patch % Lines
compliance_checker/base.py 66.66% 0 Missing and 1 partial :warning:
compliance_checker/suite.py 50.00% 0 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #1056 +/- ## =========================================== - Coverage 82.14% 82.06% -0.08% =========================================== Files 24 24 Lines 5170 5175 +5 Branches 1242 1245 +3 =========================================== Hits 4247 4247 - Misses 623 626 +3 - Partials 300 302 +2 ```

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

ocefpaf commented 2 months ago

@jcermauwedu I'm not a compliance-checker expert and I did not look too hard. Can you explain what/when/where cfutil happens to be None? Is that expected or is it an indication of a deeper problem?

jcermauwedu commented 2 months ago

Without the test for None this is the error. Still digging around for this one...

There are still some pkg references kicking around too.

======================================================================================= test session starts ========================================================================================
platform linux -- Python 3.10.14, pytest-8.1.1, pluggy-1.4.0
rootdir: /home/portal/src/compliance-checker
configfile: pyproject.toml
plugins: cov-5.0.0, flake8-1.1.1, requests-mock-1.12.1, vcr-1.0.2, time-machine-2.14.1
collected 235 items                                                                                                                                                                                

compliance_checker/tests/test_acdd.py ................                                                                                                                                       [  6%]
compliance_checker/tests/test_base.py ........                                                                                                                                               [ 10%]
compliance_checker/tests/test_cf.py ...........................................................................................                                                              [ 48%]
compliance_checker/tests/test_cf_integration.py .................                                                                                                                            [ 56%]
compliance_checker/tests/test_cli.py .........                                                                                                                                               [ 60%]
compliance_checker/tests/test_feature_detection.py ...............................                                                                                                           [ 73%]
compliance_checker/tests/test_ioos_profile.py ..........................................                                                                                                     [ 91%]
compliance_checker/tests/test_ioos_sos.py ..                                                                                                                                                 [ 91%]
compliance_checker/tests/test_protocols.py ....s                                                                                                                                             [ 94%]
compliance_checker/tests/test_suite.py .............                                                                                                                                         [ 99%]
compliance_checker/tests/test_util.py .                                                                                                                                                      [100%]

========================================================================================= warnings summary =========================================================================================
compliance_checker/tests/test_cf_integration.py::TestCFIntegration::test_cf_integration[sldmb_43093_agg-expected_messages0]
  /home/portal/src/cc-plugin-ncei/cc_plugin_ncei/util.py:6: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
    from pkg_resources import resource_filename

compliance_checker/tests/test_cf_integration.py::TestCFIntegration::test_cf_integration[sldmb_43093_agg-expected_messages0]
  /home/portal/miniconda3/envs/py310_dev/lib/python3.10/site-packages/pkg_resources/__init__.py:2832: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
  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)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================================================================== 234 passed, 1 skipped, 2 warnings in 24.25s ============================================================================
Exception ignored in: <function BaseCheck.__del__ at 0x702b0dd69fc0>
Traceback (most recent call last):
  File "/home/portal/src/compliance-checker/compliance_checker/base.py", line 198, in __del__
AttributeError: 'NoneType' object has no attribute 'get_geophysical_variables'