/usr/lib/imh-ultrastack-common/venv/lib/python3.13/site-packages/setuptools/tests
NameSizeModeActions
compat/-0755rm
config/-0755rm
indexes/-0755rm
integration/-0755rm
__pycache__/-0755rm
contexts.py31660644editdlrm
environment.py31020644editdlrm
fixtures.py122240644editdlrm
mod_with_constant.py220644editdlrm
namespaces.py27740644editdlrm
script-with-bom.py180644editdlrm
test_archive_util.py8450644editdlrm
test_bdist_deprecations.py7750644editdlrm
test_bdist_egg.py19570644editdlrm
test_bdist_wheel.py230910644editdlrm
test_build.py7980644editdlrm
test_build_clib.py31230644editdlrm
test_build_ext.py100990644editdlrm
test_build_meta.py333200644editdlrm
test_build_py.py142010644editdlrm
test_config_discovery.py225800644editdlrm
test_core_metadata.py180380644editdlrm
test_depends.py4240644editdlrm
test_develop.py31360644editdlrm
test_dist.py89510644editdlrm
test_distutils_adoption.py59870644editdlrm
test_dist_info.py50050644editdlrm
test_editable_install.py424980644editdlrm
test_egg_info.py449410644editdlrm
test_extern.py2960644editdlrm
test_find_packages.py78190644editdlrm
test_find_py_modules.py24040644editdlrm
test_glob.py8870644editdlrm
test_install_scripts.py34330644editdlrm
test_logging.py20960644editdlrm
test_manifest.py185620644editdlrm
test_namespaces.py25080644editdlrm
test_scripts.py3790644editdlrm
test_sdist.py328080644editdlrm
test_setopt.py13650644editdlrm
test_setuptools.py93230644editdlrm
test_shutil_wrapper.py6410644editdlrm
test_unicode_utils.py3160644editdlrm
test_virtualenv.py37300644editdlrm
test_warnings.py33470644editdlrm
test_wheel.py187220644editdlrm
test_windows_wrappers.py78680644editdlrm
text.py1230644editdlrm
textwrap.py980644editdlrm
__init__.py3350644editdlrm
Edit: /usr/lib/imh-ultrastack-common/venv/lib/python3.13/site-packages/setuptools/tests/test_warnings.py (3347B)
from inspect import cleandoc import pytest from setuptools.warnings import SetuptoolsDeprecationWarning, SetuptoolsWarning _EXAMPLES = { "default": dict( args=("Hello {x}", "\n\t{target} {v:.1f}"), kwargs={"x": 5, "v": 3, "target": "World"}, expected=""" Hello 5 !! ******************************************************************************** World 3.0 ******************************************************************************** !! """, ), "futue_due_date": dict( args=("Summary", "Lorem ipsum"), kwargs={"due_date": (9999, 11, 22)}, expected=""" Summary !! ******************************************************************************** Lorem ipsum By 9999-Nov-22, you need to update your project and remove deprecated calls or your builds will no longer be supported. ******************************************************************************** !! """, ), "past_due_date_with_docs": dict( args=("Summary", "Lorem ipsum"), kwargs={"due_date": (2000, 11, 22), "see_docs": "some_page.html"}, expected=""" Summary !! ******************************************************************************** Lorem ipsum This deprecation is overdue, please update your project and remove deprecated calls to avoid build errors in the future. See https://setuptools.pypa.io/en/latest/some_page.html for details. ******************************************************************************** !! """, ), } @pytest.mark.parametrize("example_name", _EXAMPLES.keys()) def test_formatting(monkeypatch, example_name): """ It should automatically handle indentation, interpolation and things like due date. """ args = _EXAMPLES[example_name]["args"] kwargs = _EXAMPLES[example_name]["kwargs"] expected = _EXAMPLES[example_name]["expected"] monkeypatch.setenv("SETUPTOOLS_ENFORCE_DEPRECATION", "false") with pytest.warns(SetuptoolsWarning) as warn_info: SetuptoolsWarning.emit(*args, **kwargs) assert _get_message(warn_info) == cleandoc(expected) def test_due_date_enforcement(monkeypatch): class _MyDeprecation(SetuptoolsDeprecationWarning): _SUMMARY = "Summary" _DETAILS = "Lorem ipsum" _DUE_DATE = (2000, 11, 22) _SEE_DOCS = "some_page.html" monkeypatch.setenv("SETUPTOOLS_ENFORCE_DEPRECATION", "true") with pytest.raises(SetuptoolsDeprecationWarning) as exc_info: _MyDeprecation.emit() expected = """ Summary !! ******************************************************************************** Lorem ipsum This deprecation is overdue, please update your project and remove deprecated calls to avoid build errors in the future. See https://setuptools.pypa.io/en/latest/some_page.html for details. ******************************************************************************** !! """ assert str(exc_info.value) == cleandoc(expected) def _get_message(warn_info): return next(warn.message.args[0] for warn in warn_info)