diff options
| author | Éric Araujo <merwok@netwok.org> | 2011-11-07 18:11:12 +0100 |
|---|---|---|
| committer | Éric Araujo <merwok@netwok.org> | 2011-11-07 18:11:12 +0100 |
| commit | b1c6f59d7100aa34a1ea39eb828f392fa0988ea6 (patch) | |
| tree | b795d4c5aeca0eb8bd24ff284b94333ad21a49be /Lib/test | |
| parent | e2618f34be2deb65799ccf073933cd61b443efd4 (diff) | |
| parent | 2a7cc5343db808b180507b202f98fe4da8e0e7fa (diff) | |
| download | cpython-git-b1c6f59d7100aa34a1ea39eb828f392fa0988ea6.tar.gz | |
Branch merge
Diffstat (limited to 'Lib/test')
| -rwxr-xr-x | Lib/test/regrtest.py | 19 |
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 |
