Skip to content

Commit

Permalink
MNT: Clean up some issues found by CodeQL
Browse files Browse the repository at this point in the history
  • Loading branch information
dopplershift committed Nov 11, 2024
1 parent 18ecca2 commit 32e3071
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/siphon/ncss.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class NCSS(HTTPEndPoint):
"""

# Need staticmethod to keep this from becoming a bound method, where self
# is passed implicitly
# is passed implicitly. Needed to avoid warning about duplicated docstring.
unit_handler = staticmethod(lambda *a, **kw: default_unit_handler(*a, **kw))

def _get_metadata(self):
Expand Down
9 changes: 3 additions & 6 deletions tests/test_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,7 @@ def test_virtual_access():
'CONUS_20km/noaaport/catalog.xml')
cat = TDSCatalog(url)
# find the 2D time coordinate "full collection" dataset
for dataset in list(cat.datasets.values()):
if 'Full Collection' in dataset.name:
ds = dataset
break
ds = cat.datasets['Full Collection (Reference / Forecast Time) Dataset']
assert 'OPENDAP' in ds.access_urls
# TwoD is a virtual dataset, so HTTPServer
# should not be listed here
Expand Down Expand Up @@ -128,8 +125,8 @@ def test_html_link(recwarn):
"""Test that we fall-back when given an HTML catalog page."""
url = ('http://thredds-test.unidata.ucar.edu/thredds/catalog/'
'grib/NCEP/RAP/CONUS_13km/catalog.html')
TDSCatalog(url)
assert 'Changing' in str(recwarn.pop(UserWarning).message)
with pytest.warns(UserWarning, match='Changing'):
TDSCatalog(url)


@recorder.use_cassette('follow_cat')
Expand Down

0 comments on commit 32e3071

Please sign in to comment.