summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2018-10-16 14:17:57 (GMT)
committerGitHub <noreply@github.com>2018-10-16 14:17:57 (GMT)
commit137b0632dccb992ca11e9445142fb33a29c33a51 (patch)
treeb18fb7d2c0f2d5d4ed2943a11f57ea513a27de92
parent1a4a10d9f125499f610787ffda8846a569fc1d97 (diff)
downloadcpython-137b0632dccb992ca11e9445142fb33a29c33a51.zip
cpython-137b0632dccb992ca11e9445142fb33a29c33a51.tar.gz
cpython-137b0632dccb992ca11e9445142fb33a29c33a51.tar.bz2
bpo-34997: Fix test_logging.ConfigDictTest.test_out_of_order (GH-9913)
When runnint test_logging with --huntrleaks after commit 18fb1fb943b7dbd7f8a76017ee2a67ef13effb85, test_out_of_order fails to raise ValueError due to the fact that the new test test_out_of_order_with_dollar_style mutates the out_of_order dictionary. Even if the test copies the dictionary first, the mutation is done in a very deep level so the original one is also affected.
-rw-r--r--Lib/test/test_logging.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py
index 9802955..c797d66 100644
--- a/Lib/test/test_logging.py
+++ b/Lib/test/test_logging.py
@@ -25,6 +25,7 @@ import logging.config
import codecs
import configparser
+import copy
import datetime
import pathlib
import pickle
@@ -3278,7 +3279,7 @@ class ConfigDictTest(BaseTest):
self.assertRaises(ValueError, self.apply_config, self.out_of_order)
def test_out_of_order_with_dollar_style(self):
- config = self.out_of_order.copy()
+ config = copy.deepcopy(self.out_of_order)
config['formatters']['mySimpleFormatter']['format'] = "${asctime} (${name}) ${levelname}: ${message}"
self.apply_config(config)