Skip to content

Commit 85fdafa

Browse files
author
Stefan Krah
authored
Replace import_fresh_module in decimal test files (GH-21815)
1 parent eaa5517 commit 85fdafa

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

Modules/_decimal/tests/bench.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,10 @@
77

88

99
import time
10-
try:
11-
from test.support import import_fresh_module
12-
except ImportError:
13-
from test.test_support import import_fresh_module
1410

15-
C = import_fresh_module('decimal', fresh=['_decimal'])
16-
P = import_fresh_module('decimal', blocked=['_decimal'])
11+
import _decimal as C
12+
import _pydecimal as P
13+
1714

1815
#
1916
# NOTE: This is the pi function from the decimal documentation, modified

Modules/_decimal/tests/deccheck.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
from queue import Queue, Empty
4444
from threading import Thread, Event, Lock
4545

46-
from test.support import import_fresh_module
4746
from randdec import randfloat, all_unary, all_binary, all_ternary
4847
from randdec import unary_optarg, binary_optarg, ternary_optarg
4948
from formathelper import rand_format, rand_locale
@@ -52,8 +51,10 @@
5251
from _testcapi import decimal_as_triple
5352
from _testcapi import decimal_from_triple
5453

55-
C = import_fresh_module('decimal', fresh=['_decimal'])
56-
P = import_fresh_module('decimal', blocked=['_decimal'])
54+
import _decimal as C
55+
import _pydecimal as P
56+
57+
5758
EXIT_STATUS = 0
5859

5960

Modules/_decimal/tests/formathelper.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,10 @@
3131

3232
import os, sys, locale, random
3333
import platform, subprocess
34-
from test.support import import_fresh_module
3534
from distutils.spawn import find_executable
3635

37-
C = import_fresh_module('decimal', fresh=['_decimal'])
38-
P = import_fresh_module('decimal', blocked=['_decimal'])
36+
import _decimal as C
37+
import _pydecimal as P
3938

4039

4140
windows_lang_strings = [

0 commit comments

Comments
 (0)