5
5
import io
6
6
import os
7
7
import re
8
+ import sys
9
+ from subprocess import check_output
8
10
9
11
from matplotlib import pyplot as plt
10
12
@@ -13,7 +15,6 @@ def _determinism_save(objects='mhi', format="pdf"):
13
15
# save current value of SOURCE_DATE_EPOCH and set it
14
16
# to a constant value, so that time difference is not
15
17
# taken into account
16
- import sys
17
18
sde = os .environ .pop ('SOURCE_DATE_EPOCH' ,None )
18
19
os .environ ['SOURCE_DATE_EPOCH' ]= "946684800"
19
20
@@ -78,8 +79,6 @@ def _determinism_check(objects='mhi', format="pdf", uid=""):
78
79
some string to add to the filename used to store the output. Use it to
79
80
allow parallel execution of two tests with the same objects parameter.
80
81
"""
81
- import sys
82
- from subprocess import check_output
83
82
from nose .tools import assert_equal
84
83
plots = []
85
84
for i in range (3 ):
@@ -112,8 +111,6 @@ def _determinism_source_date_epoch(format, string, keyword=b"CreationDate"):
112
111
a string to look at when searching for the timestamp in the document
113
112
(used in case the test fails).
114
113
"""
115
- import sys
116
- from subprocess import check_output
117
114
buff = check_output ([sys .executable ,'-R' ,'-c' ,
118
115
'import matplotlib; '
119
116
'matplotlib.use(%r); '