From 62b9ce70f7cab7d9b1be27c5ec47c8d06377c3dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Sat, 12 Sep 2009 19:27:15 +0200 Subject: Fix tests to support 3.x. --HG-- branch : distribute extra : rebase_source : e3cf4ce257e2a7969753e386c2b4bd9f654cb7fc --- tests/api_tests.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'tests') diff --git a/tests/api_tests.txt b/tests/api_tests.txt index 823d815f..6cf6e66f 100644 --- a/tests/api_tests.txt +++ b/tests/api_tests.txt @@ -119,7 +119,7 @@ editing are also a Distribution. (And, with a little attention to the directory names used, and including some additional metadata, such a "development distribution" can be made pluggable as well.) - >>> from pkg_resources import WorkingSet + >>> from pkg_resources import WorkingSet, VersionConflict A working set's entries are the sys.path entries that correspond to the active distributions. By default, the working set's entries are the items on @@ -208,11 +208,11 @@ You can ask a WorkingSet to ``find()`` a distribution matching a requirement:: Note that asking for a conflicting version of a distribution already in a working set triggers a ``pkg_resources.VersionConflict`` error: - >>> ws.find(Requirement.parse("Bar==1.0")) # doctest: +NORMALIZE_WHITESPACE - Traceback (most recent call last): - ... - VersionConflict: (Bar 0.9 (http://example.com/something), - Requirement.parse('Bar==1.0')) + >>> try: + ... ws.find(Requirement.parse("Bar==1.0")) + ... except VersionConflict: + ... print 'ok' + ok You can subscribe a callback function to receive notifications whenever a new distribution is added to a working set. The callback is immediately invoked -- cgit v1.2.3