
    "`                        d Z ddlZddlZddlZdZdej
                  v rej
                  j                  d       dZdZdej
                  v rej
                  j                  d       dZdej
                  v r*ej
                  j                  d       dej                  d	<   d
ej
                  v r*ej
                  j                  d
       dej                  d<   dej
                  v rwej
                  j                  d       ej                  j                  ej                  j                  ej                  j                  ej
                  d         d            ZndZdZddZedk(  rer ddlZ ej$                  dededd       yereddlZ ej(                  ej*                  ej,                  gdd      Zej%                  d       ej1                         Zej5                  ddd       y eee       yy)af  
python runtests.py -py
  Use py.test to run tests (more useful for debugging)

python runtests.py -coverage
  Generate test coverage report. Statistics are written to /tmp

python runtests.py -profile
  Generate profile stats (this is much slower)

python runtests.py -nogmpy
  Run tests without using GMPY even if it exists

python runtests.py -strict
  Enforce extra tests in normalize()

python runtests.py -local
  Insert '../..' at the beginning of sys.path to use local mpmath

Additional arguments are used to filter the tests to run. Only files that have
one of the arguments in their name are executed.

    NFz-profileTz	-coveragez-nogmpyYMPMATH_NOGMPYz-strictMPMATH_STRICTz-localz../.. c                 N   | r t         j                  j                  d|        |r t         j                  j                  d|       ddl}ddl}t        d|j                  j                  |j                        z         t        d|j                  j                  j                  z         t        dt        |j                        z         t        d|j                  z         t        dt         j                  z         t        d	       d
t         j                  v rHt         j                  j!                  d
       ddl}|j$                  j&                  j)                          yddl}ddlm} g }t         j                  dd }|s-|j                  j                  t         j                  d         }	n|}	|	r|	dz  }	|	dz  }	|j+                  |	      D ]  }
|j                  j1                  |j                  j3                  |
            d   }|rt4        dk(  rd}|D ]
  }||v sd} n |sYt7        |      }|j8                  j;                  dd      }|dk(  r|||gg} n|j=                  |||g        |j?                           |       }|D ]  \  }}}t        |       tA        |j8                  jC                               D ]  }
|
jE                  d      stF        rd|
v r t         jH                  jK                  d|
dd jM                  d      z   dz           |       }	  |j8                  |
            |       }t        dd||z
  z  z   dz             |       }t        d	       t        dd||z
  z  z   d z          | rt         j                  j!                  |        |r t         j                  j!                  |       yy#  t        jN                         \  }}}|tP        tR        fv r t        d	       t        d       t        d	       tU        jV                          Y xY w)!z8Run all tests in testdir while importing from importdir.   r   Nzmpmath imported from %szmpmath backend: %szmpmath mp class: %szmpmath version: %szPython version: %sr   z-py)default_timer/ztest*.py__main__FTpriorityd   i  test_numpyz           zTEST FAILED!z
ok        z%.7fz szfinished tests in z%.2fz seconds),syspathinsertos.pathmpmathprintdirname__file__libmpbackendBACKENDreprmp__version__versionargvremovepytestcmdlinemainglobtimeitr	   splitextbasename__name__
__import____dict__getappendsortsortedkeys
startswithcoveragestdoutwriteljustexc_infoKeyboardInterrupt
SystemExit	traceback	print_exc)	importdirtestdirosr   r$   r(   clockmodulesargspatternfnameokargmoduler   tstartt1etypeevaluetrbt2tends                          7/usr/lib/python3/dist-packages/mpmath/tests/runtests.pytestitrR   9   ss   9%7#	
#bggoofoo&F
FG	
!5!5!=!=
=>	
$vyy/
12	
!3!3
34	

,-	"I
1xx|ggoochhqk2GGsNG:7# 	5A77##BGG$4$4Q$78;DJ. Cd{! %F**:s;H3$dF34NNHdF34!	5$ 	&- 	I"HdF$KFOO0023 I<<(W\ JJ$$Vaekk"o%=%CDB	.**, B+vB/?@4GH#I	I( wb	"fV&<=
JKHHOOI&HHOOG$ !.-0\\^*vs %6
$CC!b	n-b	!++-s   !OAP$r   ztestit('z', 'z')r   )r1   )
ignoredirstracecountztestit(importdir, testdir)z/tmp)show_missingsummarycoverdir)r   r   )__doc__r   r@   r<   profiler"   r#   r5   environr   abspathjoinr   r>   r?   rR   r,   cProfilerunrT   Traceprefixexec_prefixtracerresultsrwrite_results     rQ   <module>ri      s  0  
HHOOJG#((HHOOK HHHOOI"%BJJHHOOI"%BJJsxxHHOOHRWW__SXXa[-I-4!6 7I I O%b zY@qI	S__(E1

/0NN	T4&Iy'" rh   