Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fb529da

Browse files
committed
TST: Remove multiple nested imports.
1 parent eef6b12 commit fb529da

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

lib/matplotlib/testing/determinism.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
import io
66
import os
77
import re
8+
import sys
9+
from subprocess import check_output
810

911
from matplotlib import pyplot as plt
1012

@@ -13,7 +15,6 @@ def _determinism_save(objects='mhi', format="pdf"):
1315
# save current value of SOURCE_DATE_EPOCH and set it
1416
# to a constant value, so that time difference is not
1517
# taken into account
16-
import sys
1718
sde = os.environ.pop('SOURCE_DATE_EPOCH', None)
1819
os.environ['SOURCE_DATE_EPOCH'] = "946684800"
1920

@@ -78,8 +79,6 @@ def _determinism_check(objects='mhi', format="pdf", uid=""):
7879
some string to add to the filename used to store the output. Use it to
7980
allow parallel execution of two tests with the same objects parameter.
8081
"""
81-
import sys
82-
from subprocess import check_output
8382
from nose.tools import assert_equal
8483
plots = []
8584
for i in range(3):
@@ -112,8 +111,6 @@ def _determinism_source_date_epoch(format, string, keyword=b"CreationDate"):
112111
a string to look at when searching for the timestamp in the document
113112
(used in case the test fails).
114113
"""
115-
import sys
116-
from subprocess import check_output
117114
buff = check_output([sys.executable, '-R', '-c',
118115
'import matplotlib; '
119116
'matplotlib.use(%r); '

0 commit comments

Comments
 (0)