From 9d63059f112c80d0419bac71596c79cd4660398d Mon Sep 17 00:00:00 2001 From: robinjhuang Date: Sat, 27 Oct 2018 18:06:46 -0400 Subject: Add unit tests for PkgResourcesDeprecationWarning --- pkg_resources/tests/test_resources.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'pkg_resources') diff --git a/pkg_resources/tests/test_resources.py b/pkg_resources/tests/test_resources.py index 171ba2f9..86afcf74 100644 --- a/pkg_resources/tests/test_resources.py +++ b/pkg_resources/tests/test_resources.py @@ -15,7 +15,7 @@ import pkg_resources from pkg_resources import ( parse_requirements, VersionConflict, parse_version, Distribution, EntryPoint, Requirement, safe_version, safe_name, - WorkingSet) + WorkingSet, PkgResourcesDeprecationWarning) # from Python 3.6 docs. @@ -492,6 +492,15 @@ class TestEntryPoints: with pytest.raises(ValueError): EntryPoint.parse_map(self.submap_str) + def testDeprecationWarnings(self): + ep = EntryPoint( + "foo", "pkg_resources.tests.test_resources", ["TestEntryPoints"], + ["x"] + ) + with pytest.warns(pkg_resources.PkgResourcesDeprecationWarning): + ep.load(require=False) + + class TestRequirements: def testBasics(self): -- cgit v1.2.3