Skip to content

Commit 137b063

Browse files
authored
bpo-34997: Fix test_logging.ConfigDictTest.test_out_of_order (GH-9913)
When runnint test_logging with --huntrleaks after commit 18fb1fb, 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.
1 parent 1a4a10d commit 137b063

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎Lib/test/test_logging.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
import codecs
2727
import configparser
28+
import copy
2829
import datetime
2930
import pathlib
3031
import pickle
@@ -3278,7 +3279,7 @@ def test_out_of_order(self):
32783279
self.assertRaises(ValueError, self.apply_config, self.out_of_order)
32793280

32803281
def test_out_of_order_with_dollar_style(self):
3281-
config = self.out_of_order.copy()
3282+
config = copy.deepcopy(self.out_of_order)
32823283
config['formatters']['mySimpleFormatter']['format'] = "${asctime} (${name}) ${levelname}: ${message}"
32833284

32843285
self.apply_config(config)

0 commit comments

Comments
 (0)