-
Notifications
You must be signed in to change notification settings - Fork 49
Open
Description
Describe the bug
========================================================================================== FAILURES ==========================================================================================
_______________________________________________________________________________ test_deprecated_grabdata_args ________________________________________________________________________________
def test_deprecated_grabdata_args():
with pytest.warns(DeprecationWarning):
import hashlib
url = _demo_url()
# dpath = ub.Path.appdir('ubelt/tests/test_download').ensuredir()
# fname = basename(url)
# fpath = join(dpath, fname)
> got_fpath = ub.grabdata(
url, hash_prefix='e09c80c42fda55f9d992e59ca6b3307d',
hasher=hashlib.md5())
tests/test_download.py:383:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
ubelt/util_download.py:444: in grabdata
stamp.renew()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ubelt.util_cache.CacheStamp object at 0x904747d00>, cfgstr = None, product = None
def renew(self, cfgstr=None, product=None):
"""
Recertify that the product has been recomputed by writing a new
certificate to disk.
Returns:
None | dict: certificate information if enabled otherwise None.
Example:
>>> # Test that renew does nothing when the cacher is disabled
>>> import ubelt as ub
>>> dpath = ub.Path.appdir('ubelt/tests/cache-stamp-renew').ensuredir()
>>> self = ub.CacheStamp('foo', dpath=dpath, enabled=False)
>>> assert self.renew() is None
"""
if not self.cacher.enabled:
return None
if cfgstr is not None: # nocover
from ubelt import schedule_deprecation
schedule_deprecation(
modname='ubelt',
migration='Do not pass cfgstr to renew. Use the class depends arg',
name='cfgstr', type='CacheStamp.renew arg',
deprecate='1.1.0', error='1.3.0', remove='1.4.0',
)
if product is not None: # nocover
from ubelt import schedule_deprecation
schedule_deprecation(
modname='ubelt',
migration='Do not pass product to renew. Use the class product arg',
name='product', type='CacheStamp.renew arg',
deprecate='1.1.0', error='1.3.0', remove='1.4.0',
)
certificate = self._new_certificate(cfgstr, product)
err = self._check_certificate_hashes(certificate)
if err:
> raise RuntimeError(err)
E RuntimeError: hash_prefix_mismatch
ubelt/util_cache.py:1211: RuntimeError
------------------------------------------------------------------------------------ Captured stdout call ------------------------------------------------------------------------------------
[cacher] ... file_10_0.txt.stamp cache miss
[cacher] stamp expired no_cert
Downloading url='http://localhost:17766/file_10_0.txt' to fpath='/disk-samsung/freebsd-ports/devel/py-ubelt/work-py39/.cache/ubelt/file_10_0.txt'
10/10... rate=129294.24 Hz, eta=0:00:00, total=0:00:00
invalid hash prefix value (expected "e09c80c42fda55f9d992e59ca6b3307d", got "22d42eb002cefa81e9ad604ea57bc01d")
====================================================================================== warnings summary ======================================================================================
../../../../../../usr/local/lib/python3.9/site-packages/pytest_freezegun.py:17
/usr/local/lib/python3.9/site-packages/pytest_freezegun.py:17: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
if LooseVersion(pytest.__version__) < LooseVersion('3.6.0'):
tests/test_pathlib.py::test_move_meta
tests/test_pathlib.py::test_move_basic
tests/test_pathlib.py::test_move_dir_to_existing_dir_noconflict
tests/test_pathlib.py::test_move_dir_to_existing_dir_withconflict
tests/test_pathlib.py::test_move_dir_to_non_existing
tests/test_pathlib.py::test_move_to_nested_non_existing
/disk-samsung/freebsd-ports/devel/py-ubelt/work-py39/ubelt-1.2.3/ubelt/util_path.py:1384: UserWarning: The ub.Path.move function is experimental and may change! Do not rely on this behavior yet!
warnings.warn('The ub.Path.move function is experimental and may change! '
tests/test_pathlib.py::test_copy_dir_to_existing_dir_withconflict
tests/test_pathlib.py::test_copy_meta
tests/test_pathlib.py::test_copy_basic
tests/test_pathlib.py::test_copy_to_nested_non_existing_with_different_symlink_flags
tests/test_pathlib.py::test_copy_dir_to_non_existing
tests/test_pathlib.py::test_copy_dir_to_existing_dir_noconflict
/disk-samsung/freebsd-ports/devel/py-ubelt/work-py39/ubelt-1.2.3/ubelt/util_path.py:1291: UserWarning: The ub.Path.copy function is experimental and may change, in corner cases. Primary cases seem stable.
warnings.warn('The ub.Path.copy function is experimental and may change, '
tests/test_indexable.py::test_indexable_walker_map_patterns
/disk-samsung/freebsd-ports/devel/py-ubelt/work-py39/ubelt-1.2.3/ubelt/util_indexable.py:506: DeprecationWarning: The "indexable_allclose" function was deprecated, will cause an error and will be removed. The current version is 1.2.3. Use `ub.IndexableWalker(items1).allclose(ub.IndexableWalker(items2))` instead
ub.schedule_deprecation(
tests/test_path.py::test_tempdir
tests/test_import.py::test_import_modpath_basic
tests/test_import.py::test_package_submodules
tests/test_import.py::test_import_modpath_package
tests/test_import.py::test_modpath_to_modname
tests/test_import.py::test_modname_to_modpath_package
tests/test_import.py::test_modname_to_modpath_single
tests/test_import.py::test_modname_to_modpath_namespace
/disk-samsung/freebsd-ports/devel/py-ubelt/work-py39/ubelt-1.2.3/ubelt/util_path.py:368: DeprecationWarning: The "TempDir" class was deprecated in 1.2.0, will cause an error in 1.4.0 and will be removed in 1.5.0. The current version is 1.2.3. Use tempfile instead
ub.schedule_deprecation(
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================================================================================== short test summary info ===================================================================================
SKIPPED [1] tests/test_futures.py:42: long test, demos that timeout does not work with SerialExecutor
SKIPPED [1] tests/test_editable_modules.py:415: UBELT_DO_EDITABLE_TESTS is not enabled
SKIPPED [1] tests/test_hash.py:435: blake3 is not available
SKIPPED [1] tests/test_download.py:256: This takes a long time to timeout and I dont understand why
=================================================================== 1 failed, 202 passed, 4 skipped, 22 warnings in 5.90s ====================================================================
Desktop (please complete the following information):
- OS: FreeBSD 13.1
- Ubelt version 1.2.3
- Python version 3.9
Metadata
Metadata
Assignees
Labels
No labels