def bigmemtest(minsize, memuse, overhead=(5 * _1M)):
 def decorator(f):
  def wrapper(self):
   if (not max_memuse):
    maxsize = 5147
    self.failIf((((maxsize * memuse) + overhead) > (20 * _1M)))
   else:
    maxsize = int(((max_memuse - overhead) / memuse))
    if (maxsize < minsize):
     if verbose:
      sys.stderr.write(('Skipping %s because of memory constraint\n' % (f.__name__,)))
     return
    maxsize = max((maxsize - (50 * _1M)), minsize)
   return f(self, maxsize)
  wrapper.minsize = minsize
  wrapper.memuse = memuse
  wrapper.overhead = overhead
  return wrapper
 return decorator

def bigmemtest ( minsize , memuse , overhead = ( 5 * _1M ) ) : def decorator ( f ) : def wrapper ( self ) : if ( not max_memuse ) : maxsize = 5147 self . failIf ( ( ( ( maxsize * memuse ) + overhead ) > ( 20 * _1M ) ) ) else : maxsize = int ( ( ( max_memuse - overhead ) / memuse ) ) if ( maxsize < minsize ) : if verbose : sys . stderr . write ( ( 'Skipping %s because of memory constraint\n' % ( f . __name__ , ) ) ) return maxsize = max ( ( maxsize - ( 50 * _1M ) ) , minsize ) return f ( self , maxsize ) wrapper . minsize = minsize wrapper . memuse = memuse wrapper . overhead = overhead return wrapper return decorator
decorator for bigmem tests .