bpo-36160: Fix test_site so that it can run independently of other tests (GH-12131) (GH-26263)

(cherry picked from commit 1270ad6ec8)

Co-authored-by: native-api <vano@mail.mipt.ru>
This commit is contained in:
Miss Islington (bot) 2021-05-20 03:41:43 -07:00 committed by GitHub
parent eecdc9e1f7
commit b9258b03b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -76,8 +76,10 @@ class HelperFunctionsTests(unittest.TestCase):
site.USER_SITE = self.old_site
site.PREFIXES = self.old_prefixes
sysconfig._CONFIG_VARS = self.original_vars
sysconfig._CONFIG_VARS.clear()
sysconfig._CONFIG_VARS.update(self.old_vars)
# _CONFIG_VARS is None before get_config_vars() is called
if sysconfig._CONFIG_VARS is not None:
sysconfig._CONFIG_VARS.clear()
sysconfig._CONFIG_VARS.update(self.old_vars)
def test_makepath(self):
# Test makepath() have an absolute path for its first return value