def _determinism_check(objects=u'mhi', format=u'pdf', usetex=False):
 plots = []
 for i in range(3):
  result = check_output([sys.executable, u'-R', u'-c', (u'import matplotlib; matplotlib._called_from_pytest = True; matplotlib.use(%r); from matplotlib.testing.determinism import _determinism_save;_determinism_save(%r,%r,%r)' % (format, objects, format, usetex))])
  plots.append(result)
 for p in plots[1:]:
  if usetex:
   if (p != plots[0]):
    pytest.skip(u'failed, maybe due to ghostscript timestamps')
  else:
   assert (p == plots[0])

def _determinism_check ( objects = u'mhi' , format = u'pdf' , usetex = False ) : plots = [ ] for i in range ( 3 ) : result = check_output ( [ sys . executable , u'-R' , u'-c' , ( u'import matplotlib; matplotlib._called_from_pytest = True; matplotlib.use(%r); from matplotlib.testing.determinism import _determinism_save;_determinism_save(%r,%r,%r)' % ( format , objects , format , usetex ) ) ] ) plots . append ( result ) for p in plots [ 1 : ] : if usetex : if ( p != plots [ 0 ] ) : pytest . skip ( u'failed, maybe due to ghostscript timestamps' ) else : assert ( p == plots [ 0 ] )
output three times the same graphs and checks that the outputs are exactly the same .