summaryrefslogtreecommitdiff
path: root/Lib/test/regrtest.py
diff options
context:
space:
mode:
authorBrian Curtin <brian@python.org>2011-11-07 14:19:46 -0600
committerBrian Curtin <brian@python.org>2011-11-07 14:19:46 -0600
commitca0fbc02e9971ead5436473e15320652c1fd97c8 (patch)
tree4b54cf71920a50bceed96d6f575ed1cbf0abac17 /Lib/test/regrtest.py
parentc1b65d1831265534cb1613d7bf0ad7643fddb795 (diff)
parentca6befb77f007ee74137bcbfc26f3fe1345bd886 (diff)
downloadcpython-git-ca0fbc02e9971ead5436473e15320652c1fd97c8.tar.gz
branch merge
Diffstat (limited to 'Lib/test/regrtest.py')
-rwxr-xr-xLib/test/regrtest.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py
index bbda525bea..9fe7bbabc7 100755
--- a/Lib/test/regrtest.py
+++ b/Lib/test/regrtest.py
@@ -172,6 +172,7 @@ import io
import json
import logging
import os
+import packaging.command
import packaging.database
import platform
import random
@@ -967,7 +968,7 @@ class saved_test_environment:
'sys.warnoptions', 'threading._dangling',
'multiprocessing.process._dangling',
'sysconfig._CONFIG_VARS', 'sysconfig._SCHEMES',
- 'packaging.database_caches',
+ 'packaging.command._COMMANDS', 'packaging.database_caches',
)
def get_sys_argv(self):
@@ -1055,6 +1056,22 @@ class saved_test_environment:
# Can't easily revert the logging state
pass
+ def get_packaging_command__COMMANDS(self):
+ # registry mapping command names to full dotted path or to the actual
+ # class (resolved on demand); this check only looks at the names, not
+ # the types of the values (IOW, if a value changes from a string
+ # (dotted path) to a class it's okay but if a key (i.e. command class)
+ # is added we complain)
+ id_ = id(packaging.command._COMMANDS)
+ keys = set(packaging.command._COMMANDS)
+ return id_, keys
+ def restore_packaging_command__COMMANDS(self, saved):
+ # if command._COMMANDS was bound to another dict obhect, we can't
+ # restore the previous object and contents, because the get_ method
+ # above does not return the dict object (to ignore changes in values)
+ for key in packaging.command._COMMANDS.keys() - saved[1]:
+ del packaging.command._COMMANDS[key]
+
def get_packaging_database_caches(self):
# caching system used by the PEP 376 implementation
# we have one boolean and four dictionaries, initially empty