î
5dÝVÞ  ã               @   s­  d  d l  Z  d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m	 Z	 d d	 l m
 Z
 d d
 l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z e  j d d … d k rxd d l m Z n d Z d d „  Z e d k r©e j d d ƒ n  d S)é    Né   )Údsn)Úunittest)Ú
test_async)Útest_bugX000)Útest_bug_gc)Útest_cancel)Útest_connection)Ú	test_copy)Útest_cursor)Ú
test_dates)Útest_extras_dictcursor)Ú
test_green)Útest_lobject)Útest_module)Útest_notify)Útest_psycopg2_dbapi20)Ú
test_quote)Útest_transaction)Útest_types_basic)Útest_types_extrasé   é   )Ú	test_withc              C   s   d d  l  }  y |  j t ƒ } WnR t k
 rs } z2 t d | j j | ƒ t d ƒ t j d ƒ WYd  d  } ~ Xn X| j	 ƒ  t
 j ƒ  } | j t j ƒ  ƒ | j t j ƒ  ƒ | j t j ƒ  ƒ | j t j ƒ  ƒ | j t j ƒ  ƒ | j t j ƒ  ƒ | j t j ƒ  ƒ | j t j ƒ  ƒ | j t j ƒ  ƒ | j t j ƒ  ƒ | j t j ƒ  ƒ | j t j ƒ  ƒ | j t j ƒ  ƒ | j t j ƒ  ƒ | j t j ƒ  ƒ | j t j ƒ  ƒ | j t j ƒ  ƒ | j t j ƒ  ƒ t  rü| j t  j ƒ  ƒ n  | S)Nr   zFailed connection to test db:z7Please set env vars 'PSYCOPG2_TESTDB*' to valid values.r   )!Úpsycopg2Úconnectr   Ú	ExceptionÚprintÚ	__class__Ú__name__ÚsysÚexitÚcloser   Z	TestSuiteZaddTestr   Ú
test_suiter   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   )r   ZcnnÚeÚsuite© r&   ú;/tmp/pip-build-0jahl3lb/psycopg2/psycopg2/tests/__init__.pyr#   5   s<    
 
r#   Ú__main__ZdefaultTest)r   r   )r    Z
testconfigr   Z	testutilsr   Ú r   r   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   Úversion_infor   r#   r   Úmainr&   r&   r&   r'   Ú<module>   s4   #