o
    HXh                    @   s  d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dl	Z	d dl
mZmZ d dlmZ d dlmZ d dlmZ d dlmZ G dd deZd	d
 Zdd Zdd Zdd Zdd Zdd Zdd Zdd Zdd Zdd Z dd Z!dd  Z"d!d" Z#d#d$ Z$d%d& Z%e&d'Z'e(d(e'j) d)d* Z*d+d, Z+d-d. Z,d/d0 Z-d1d2 Z.d3d4 Z/d5d6 Z0d7d8 Z1d9d: Z2d;d< Z3d=d> Z4d?d@ Z5dAdB Z6dCdD Z7dEdF Z8dGdH Z9dIdJ Z:dKdL Z;G dMdN dNej<Z=G dOdP dPej<Z>dQdR Z?e@dSkreA  dS dS )T    N)	ExitStackredirect_stdout)StringIO)	os_helper)
_FakeInput)patchc                   @   s&   e Zd Z	 dd Zdd Zdd ZdS )PdbTestInputc                 C   s
   || _ d S N)input)selfr
    r   7/opt/python-3.10.19/usr/lib/python3.10/test/test_pdb.py__init__   s   
zPdbTestInput.__init__c                 C   s6   t j| _t| jt _tt drt  | _d S d | _d S )Ngettrace)sysstdin
real_stdinr   r
   hasattrr   
orig_tracer   r   r   r   	__enter__   s   "zPdbTestInput.__enter__c                 G   s"   | j t_| jrt| j d S d S r	   )r   r   r   r   settrace)r   excr   r   r   __exit__!   s   zPdbTestInput.__exit__N)__name__
__module____qualname__r   r   r   r   r   r   r   r      s
    r   c                   C      d S r	   r   r   r   r   r   test_pdb_displayhook'      r   c                   C   r   r	   r   r   r   r   r   test_pdb_basic_commandsD   r   r    c                  C   s   dd l } | j  d S )Nr   )bdbZ
BreakpointZclearBreakpoints)r!   r   r   r   reset_Breakpoint   s   r"   c                   C   r   r	   r   r   r   r   r   test_pdb_breakpoint_commands   r   r#   c                   C   r   r	   r   r   r   r   r   :test_pdb_breakpoints_preserved_across_interactive_sessionsG  r   r$   c                   C   r   r	   r   r   r   r   r   test_pdb_pp_repr_exc  r   r%   c                   C   r   r	   r   r   r   r   r   
do_nothing  r   r&   c                   C   s   t d d S )N*   )printr   r   r   r   do_something     r)   c                   C   r   r	   r   r   r   r   r   test_list_commands  r   r+   c                   C   r   r	   r   r   r   r   r   test_pdb_whatis_command  r   r,   c                   C   r   r	   r   r   r   r   r   test_pdb_display_command5  r   r-   c                   C   r   r	   r   r   r   r   r   test_pdb_alias_commandg  r   r.   c                   C   r   r	   r   r   r   r   r   test_pdb_where_command  r   r/   c                   C   r   r	   r   r   r   r   r   test_post_mortem  r   r0   c                   C   r   r	   r   r   r   r   r   test_pdb_skip_modules	  r   r1   Zmodule_to_skipz6def foo_pony(callback): x = 1; callback(); return Nonec                   C   r   r	   r   r   r   r   r   #test_pdb_skip_modules_with_callback%  r   r2   c                   C   r   r	   r   r   r   r   r    test_pdb_continue_in_bottomframeP  r   r3   c                 C   s   	 t tjddd| | d S )NTF)ZnosigintZreadrc)getattrpdbPdb)methodargr   r   r   
pdb_invokez  s   r9   c                   C   r   r	   r   r   r   r   r   $test_pdb_run_with_incorrect_argument  r   r:   c                   C   r   r	   r   r   r   r   r   test_pdb_run_with_code_object  r   r;   c                   C   r   r	   r   r   r   r   r   &test_next_until_return_at_return_event  r   r<   c                   C   r   r	   r   r   r   r   r   #test_pdb_next_command_for_generator  r   r=   c                   C   r   r	   r   r   r   r   r   #test_pdb_next_command_for_coroutine   r   r>   c                   C   r   r	   r   r   r   r   r   "test_pdb_next_command_for_asyncgenX  r   r?   c                   C   r   r	   r   r   r   r   r   %test_pdb_return_command_for_generator  r   r@   c                   C   r   r	   r   r   r   r   r   %test_pdb_return_command_for_coroutine  r   rA   c                   C   r   r	   r   r   r   r   r   $test_pdb_until_command_for_generator  r   rB   c                   C   r   r	   r   r   r   r   r   $test_pdb_until_command_for_coroutine"  r   rC   c                   C   r   r	   r   r   r   r   r   +test_pdb_next_command_in_generator_for_loopQ  r   rD   c                   C   r   r	   r   r   r   r   r   !test_pdb_next_command_subiterator{  r   rE   c                   C   r   r	   r   r   r   r   r   test_pdb_issue_20766  r   rF   c                   C   r   r	   r   r   r   r   r   test_pdb_issue_43318  r   rG   c                   C   r   r	   r   r   r   r   r   test_pdb_issue_gh_101673  r   rH   c                   @   s"  e Zd Zdd Zdd Zdd Zdd Zd	d
 Zdd Zdd Z	dd Z
dd Zdd Zdd Zdd Zdd Zdd Zdd Zdd  Zd!d" Zd#d$ Zd%d& Zd'd( Zd)d* Zd+d, Zd-d. Zd/d0 Zd1d2 Zd3d4 Zd5d6 Zd7d8 Zd9d: Zd;d< Z d=d> Z!e"j#d?d@ Z$dAdB Z%dCdD Z&dES )FPdbTestCasec                 C      t t j d S r	   r   unlinkTESTFNr   r   r   r   tearDown     zPdbTestCase.tearDownc                 C   s   |  tjd tjddg| }tj|tjtjtji t	j
ddid}|t|\}}W d    n1 s8w   Y  |oCt|}|oJt|}||fS )N__pycache__-mr5   PYTHONIOENCODINGutf-8stdoutr   stderrenv)
addCleanupr   rmtreer   
executable
subprocessPopenPIPESTDOUTosenvironcommunicatestrencodebytesdecode)r   Zpdb_argscommandscmdprocrU   rV   r   r   r   _run_pdb  s   zPdbTestCase._run_pdbc                 C   s\   	 d}t |d}|t| W d    n1 sw   Y  | tj| | |g|S )Nmain.pyw)openwritetextwrapdedentrX   r   rL   ri   )r   scriptrf   filenamefr   r   r   run_pdb_script  s   zPdbTestCase.run_pdb_scriptc                 C   s   	 d| _ t| j  | j d }| j d }t| j  t|d}W d    n1 s*w   Y  t|d}|t| W d    n1 sGw   Y  | 	tj| j  | 
d| j g|S )Nt_main/__main__.py/__init__.pyrk   rQ   )module_namer   rY   r_   mkdirrl   rm   rn   ro   rX   ri   )r   rp   rf   	main_file	init_filerr   r   r   r   run_pdb_module  s   

zPdbTestCase.run_pdb_modulec                 C   sl   t tjd}|| W d    n1 sw   Y  |sd n	|d tj|d f}| |t|tj d S )Nwbr      )rl   r   rM   rm   assertEqualr5   Zfind_function)r   Zfile_content	func_nameexpectedrr   r   r   r   _assert_find_function'  s   z!PdbTestCase._assert_find_functionc                 C   s   |  ddd  d S )N    Zfoo)r   r   r   r   r   test_find_function_empty_file0  s   z)PdbTestCase.test_find_function_empty_filec                 C   s   |  d dd d S )Nu@   def foo():
    pass

def bœr():
    pass

def quux():
    pass
   bœr)r      r   rc   r   r   r   r   test_find_function_found3  s   	z$PdbTestCase.test_find_function_foundc                 C   s   |  dddd d S )NuV   # coding: iso-8859-15
def foo():
    pass

def bœr():
    pass

def quux():
    pass
ziso-8859-15r   )r      r   r   r   r   r   -test_find_function_found_with_encoding_cookieC  s   
z9PdbTestCase.test_find_function_found_with_encoding_cookiec                 C   s   |  tjd  dd d S )Nu   def bœr():
    pass
r   )r   r}   )r   codecsBOM_UTF8rc   r   r   r   r   !test_find_function_found_with_bomT  s   z-PdbTestCase.test_find_function_found_with_bomc                 C   s   t tjd}|d W d    n1 sw   Y  tjddtjg}tj|tjtjtj	d}| 
|jj |d\}}| d|d d S )	Nr|   s   print("testing my pdb")
rQ   r5   rU   r   rV   s   quit
s   SyntaxErrorz0Got a syntax error running test script under PDB)rl   r   rM   rm   r   rZ   r[   r\   r]   r^   rX   rU   closera   assertNotInr   rr   rg   rh   rU   rV   r   r   r   test_issue7964^  s   zPdbTestCase.test_issue7964c                 C   sH   d}d}|  ||\}}|pd|pd }| d|d | d|d d S )Nz
            def do_testcmdwithnodocs(self, arg):
                pass

            import pdb
            pdb.Pdb.do_testcmdwithnodocs = do_testcmdwithnodocs
        zA
            continue
            help testcmdwithnodocs
         AttributeErrorzCCalling help on a command with no docs should be handled gracefullyz;*** No help for 'testcmdwithnodocs'; __doc__ string missingz<Calling help on a command with no docs should print an error)rs   r   assertIn)r   rp   rf   rU   rV   outputr   r   r   test_issue46434m  s   zPdbTestCase.test_issue46434c                 C   s   d}d}d}t dd}|t| W d    n1 sw   Y  | tjd | ||\}}| t	dd |
 D d d S )	Nz
            from bar import bar

            def foo():
                bar()

            def nope():
                pass

            def foobar():
                foo()
                nope()

            foobar()
        z
            from bar import bar
            break bar
            continue
            step
            step
            quit
        z5
            def bar():
                pass
        zbar.pyrk   c                 s       | ]}d |v V  qdS )zmain.py(5)foo()->NoneNr   .0lr   r   r   	<genexpr>      z.PdbTestCase.test_issue13183.<locals>.<genexpr>z+Fail to step into the caller after a return)rl   rm   rn   ro   rX   r   rL   rs   
assertTrueany
splitlines)r   rp   rf   Zbarrr   rU   rV   r   r   r   test_issue13183  s   zPdbTestCase.test_issue13183c                 C      t tjd}|tdd W d    n1 sw   Y  tjdtjg}t	j
|t	jt	jt	ji tjddid}| |jj |d\}}| d	|d
 d S )Nr|   a  
                import threading
                import pdb

                def start_pdb():
                    pdb.Pdb(readrc=False).set_trace()
                    x = 1
                    y = 1

                t = threading.Thread(target=start_pdb)
                t.start()ascii-urR   rS   rT   s   cont
   Error*Got an error running test script under PDBrl   r   rM   rm   rn   ro   rc   r   rZ   r[   r\   r]   r^   r_   r`   rX   rU   r   ra   r   r   r   r   r   test_issue13120  s"   
zPdbTestCase.test_issue13120c                 C   r   )Nr|   a  
                import threading
                import pdb

                evt = threading.Event()

                def start_pdb():
                    evt.wait()
                    pdb.Pdb(readrc=False).set_trace()

                t = threading.Thread(target=start_pdb)
                t.start()
                pdb.Pdb(readrc=False).set_trace()
                evt.set()
                t.join()r   r   rR   rS   rT   s
   cont
cont
r   r   r   r   r   r   r   test_issue36250  s"   zPdbTestCase.test_issue36250c                 C   s6   d}d}d}|  ||\}}| ||d|| d S )Nzdef f: pass
r   zSyntaxError:zE

Expected:
{}
Got:
{}
Fail to handle a syntax error in the debuggee.)rs   r   format)r   rp   rf   r   rU   rV   r   r   r   test_issue16180  s   zPdbTestCase.test_issue16180c                 C   sL   d}d}|  ||\}}ddd | D }| |d | |d d S )Nzprint('hello')z[
            continue
            run a b c
            run d e f
            quit
        
c                 S   s   g | ]}|  qS r   )strip)r   xr   r   r   
<listcomp>  s    z/PdbTestCase.test_issue26053.<locals>.<listcomp>z#Restarting .* with arguments:
a b cz#Restarting .* with arguments:
d e f)rs   joinr   ZassertRegex)r   rp   rf   rU   rV   resr   r   r   test_issue26053  s   zPdbTestCase.test_issue26053c              	   C   s:  t d}tjdd }zt l tdd}|d W d    n1 s'w   Y  tdd}|| W d    n1 sAw   Y  t	j
dg}tj|tjtjtjd}| |d\}}| d	| W d    n1 sqw   Y  W d    n1 sw   Y  W |d ur|tjd< d S d S |d ur|tjd< w )
Nz_
            import pdb; pdb.Pdb(readrc=False).set_trace()

            print('hello')
        HOME.pdbrcrk   zinvalid
rj   r   s   q
s(   NameError: name 'invalid' is not defined)rn   ro   r_   r`   popr   temp_cwdrl   rm   r   rZ   r[   r\   r]   ra   r   )r   rp   	save_homerr   rg   rh   rU   rV   r   r   r   test_readrc_kwarg  s<   


zPdbTestCase.test_readrc_kwargc                 C   s  t jdd }t l}tdO t j|d}|t jj_	z0t
|d}|d W d    n1 s3w   Y  | t jd d W |d urM|t jd< n
|d urW|t jd< w W d    n1 sbw   Y  W d    d S W d    d S 1 szw   Y  d S )Nr   zos.path.expanduserr   rk   invalidr   )r_   r`   r   r   temp_dirr   pathr   
expanduserZreturn_valuerl   rm   r~   r5   r6   ZrcLines)r   r   r   Zrc_pathrr   r   r   r   test_readrc_homedir  s    

PzPdbTestCase.test_readrc_homedirc                 C   sx   t  }d}t  }|td| |ttjd tj|d W d    n1 s+w   Y  | |	 |d  d S )Nz"Nobody expects... blah, blah, blahz
sys.stdout	set_trace)headerr   )
r   r   enter_contextr   objectr5   r6   r   r~   getvalue)r   rU   r   Z	resourcesr   r   r   test_header&  s   zPdbTestCase.test_headerc                 C   :   d}d}|  ||\}}| tdd | D | d S )Nzprint("SUCCESS")/
            continue
            quit
        c                 s   r   SUCCESSNr   r   r   r   r   r   6  r   z.PdbTestCase.test_run_module.<locals>.<genexpr>r{   r   r   r   r   rp   rf   rU   rV   r   r   r   test_run_module/  s   "zPdbTestCase.test_run_modulec                 C   r   )NzQ
            if __name__ == '__main__':
                print("SUCCESS")
        r   c                 s   r   r   r   r   r   r   r   r   B  r   z9PdbTestCase.test_module_is_run_as_main.<locals>.<genexpr>r   r   r   r   r   test_module_is_run_as_main8  s   "z&PdbTestCase.test_module_is_run_as_mainc                 C   sX   d}d}|  ||\}}| tdd | D | | tdd | D | d S )Nz{
            if __name__ == '__main__':
                pass
                print("SUCCESS")
                pass
        z*
            b 3
            quit
        c                 s   r   )zBreakpoint 1 atNr   r   r   r   r   r   P  r   z.PdbTestCase.test_breakpoint.<locals>.<genexpr>c                 s   s    | ]}d |vV  qdS r   r   r   r   r   r   r   Q  r   )r{   r   r   r   allr   r   r   r   test_breakpointD  s
   "zPdbTestCase.test_breakpointc                 C   s2   d}|  ddg|\}}| tj|dd d S )Nz(
            c
            quit
        rQ   r5   r   )ri   r   r5   Z_usagereplace)r   rf   rU   rV   r   r   r   test_run_pdb_with_pdbS  s   
z!PdbTestCase.test_run_pdb_with_pdbc                 C   s   d}t | |d }t| t|d W d    n1 s w   Y  | t j| | d|gd\}}| d|  d S )Nrt   rv   rk   rQ   r   z,ImportError: No module named t_main.__main__)	r   rY   r_   rx   rl   rX   ri   r   r   )r   rw   rz   rU   rV   r   r   r   test_module_without_a_main^  s   

z&PdbTestCase.test_module_without_a_mainc                 C   s   d}d}t | |d | }t| t|d d W d    n1 s&w   Y  | t j| | d|ddgd\}}| d	| d S )
NZt_pkgrt   /rv   rk   rQ   .r   z;'t_pkg.t_main' is a package and cannot be directly executed)	r   rY   r_   makedirsrl   rX   ri   r   r   )r   Zpkg_namerw   modpathrU   rV   r   r   r   test_package_without_a_mainj  s   

z'PdbTestCase.test_package_without_a_mainc                 C   r   )NzY
                #This is a comment, on line 2

                print("SUCCESS")
        z
            quit
        c                 s   r   )z__main__.py(4)<module>()Nr   r   r   r   r   r     s    z=PdbTestCase.test_blocks_at_first_code_line.<locals>.<genexpr>r   r   r   r   r   test_blocks_at_first_code_linex  s   z*PdbTestCase.test_blocks_at_first_code_linec                 C   sn  d| _ t| j  | j d }| j d }| j d }| tj| j  t| j  t|d}|t	d W d    n1 s>w   Y  t|d}|t	d W d    n1 s[w   Y  t|d}|t	d W d    n1 sxw   Y  d	}| 
d
| j g|\}}| tdd | D | | tdd | D  | tdd | D  d S )Nrt   ru   rv   
/module.pyrk   6
                top_var = "VAR from top"
            z
                from . import top_var
                from .module import var
                from . import module
                pass # We'll stop here and print the vars
            zY
                var = "VAR from module"
                var2 = "second var"
            zz
            b 5
            c
            p top_var
            p var
            p module.var2
            quit
        rQ   c                 s   r   zVAR from moduleNr   r   r   r   r   r     r   z4PdbTestCase.test_relative_imports.<locals>.<genexpr>c                 s   r   )zVAR from topNr   r   r   r   r   r     r   c                 s   r   )z
second varNr   r   r   r   r   r     r   rw   r   rY   rX   r_   rx   rl   rm   rn   ro   ri   r   r   r   r   ry   rz   Zmodule_filerr   rf   rU   _r   r   r   test_relative_imports  s*   


 z!PdbTestCase.test_relative_importsc                 C   s:  d| _ t| j  | j d }| j d }| j d }| tj| j  t| j  t|d}|t	d W d    n1 s>w   Y  t|d}|t	d W d    n1 s[w   Y  t|d}|t	d W d    n1 sxw   Y  d	}| 
d
| j d g|\}}| tdd | D | d S )Nrt   z	/runme.pyrv   r   rk   r   zl
                from . import module
                pass # We'll stop here and print the vars
            z5
                var = "VAR from module"
            zQ
            b 3
            c
            p module.var
            quit
        rQ   z.runmec                 s   r   r   r   r   r   r   r   r     r   zDPdbTestCase.test_relative_imports_on_plain_module.<locals>.<genexpr>r   r   r   r   r   %test_relative_imports_on_plain_module  s&   


"z1PdbTestCase.test_relative_imports_on_plain_modulec                 C   sB   d g d}| d|d \}}| | dd  g d d S )Nr   )zprint(zdebug print(zdebug doesnotexistcpassr}   )
-> passz+(Pdb) *** SyntaxError: '(' was never closed!(Pdb) ENTERING RECURSIVE DEBUGGERz%*** SyntaxError: '(' was never closedLEAVING RECURSIVE DEBUGGERr   z> <string>(1)<module>()z9((Pdb)) *** NameError: name 'doesnotexist' is not definedr   (Pdb) r   rs   r~   r   )r   rf   rU   r   r   r   r   test_errors_in_command  s    z"PdbTestCase.test_errors_in_commandc                    s&   	  fdd}|dd |dd d S )Nc                    sV   d d|  dg} d|d \}} | dd  dd|  d| d	g d S )
Nr   zrun qr   r}   r   z(Pdb) *** Cannot run z: r   r   )Zbad_argmsgrf   rU   r   r   r   r   check  s   
z*PdbTestCase.test_issue34266.<locals>.check\zNo escaped character"zNo closing quotationr   )r   r   r   r   r   test_issue34266  s   
zPdbTestCase.test_issue34266c                 C   s|   	 t d}d}t (}dtj| }| ||\}}| |	dd 
d| W d    d S 1 s7w   Y  d S )NQ
            import sys
            print('sys.path[0] is', sys.path[0])
        c
q(Pdb) sys.path[0] is r      r   )rn   ro   r   r   r_   r   realpathrs   r~   splitrstrip)r   rp   rf   cwdr   rU   rV   r   r   r   test_issue42384  s   

"zPdbTestCase.test_issue42384c           
   	   C   s  	 t d}d}t w}tj|}tj|d}tj|d}d| }t| t	tj|dd}|
| W d    n1 sEw   Y  t| ttj|dtj|d | tjddg|\}}	| |dd	 d
| W d    d S 1 sw   Y  d S )Nr   r   dir_onedir_twor   foo.pyrk   r   r   r   )rn   ro   r   r   r_   r   r   r   rx   rl   rm   symlinkri   r~   r   r   )
r   rp   rf   r   r   r   r   rr   rU   rV   r   r   r   test_issue42384_symlink   s"   




 "z#PdbTestCase.test_issue42384_symlinkc           	   	   C   s  t  x}tdd}td}|| W d    n1 sw   Y  tj|d}t	| t	tj|d tj|d}t|d}|d W d    n1 sVw   Y  | 
dgd\}}d}| |dd	 d
| W d    d S 1 sw   Y  d S )Nr   rk   z
                    print('The correct file was executed')

                    import os
                    os.chdir("subdir")
                subdirz$print("The wrong file was executed")zc
c
qz#(Pdb) The correct file was executedr      r   )r   r   rl   rn   ro   rm   r_   r   r   rx   ri   r~   r   r   )	r   r   rr   sr   Z
wrong_filerU   rV   r   r   r   r   test_issue42383  s    

	
"zPdbTestCase.test_issue42383c                 C   s   d}d}d}t dd}|t| W d    n1 sw   Y  t dd}|t| W d    n1 s;w   Y  | tjd | tjd | dg|\}}| d|d d S )	Nza
        def func():
            x = "Sentinel string for gh-93696"
            print(x)
        aL  
        import os
        import sys

        def _create_fake_frozen_module():
            with open('gh93696.py') as f:
                src = f.read()

            # this function has a co_filename as if it were in a frozen module
            dummy_mod = compile(src, "<frozen gh93696>", "exec")
            func_code = dummy_mod.co_consts[0]

            mod = type(sys)("gh93696")
            mod.func = type(lambda: None)(func_code, mod.__dict__)
            mod.__file__ = 'gh93696.py'

            return mod

        mod = _create_fake_frozen_module()
        mod.func()
        zf
            break 20
            continue
            step
            list
            quit
        z
gh93696.pyrk   zgh93696_host.pyz"x = "Sentinel string for gh-93696"zSentinel statement not found)	rl   rm   rn   ro   rX   r   rL   ri   r   )r   Z
frozen_srcZhost_programrf   rr   rU   rV   r   r   r   test_gh_93696_frozen_list1  s   z%PdbTestCase.test_gh_93696_frozen_listN)'r   r   r   rN   ri   rs   r{   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   Zskip_unless_symlinkr   r   r   r   r   r   r   rI     sH    	
$ 		%
rI   c                   @   s4   e Zd Zdd Zdd Zdd Zdd Zd	d
 ZdS )ChecklineTestsc                 C   s   t   d S r	   )	linecache
clearcacher   r   r   r   setUp`  r*   zChecklineTests.setUpc                 C   rJ   r	   rK   r   r   r   r   rN   c  rO   zChecklineTests.tearDownc                 C   sX   t tjd}|d W d    n1 sw   Y  t }| |tjdd d S Nrk   z
print(123)r}   )rl   r   rM   rm   r5   r6   r~   	checkliner   rr   dbr   r   r   test_checkline_before_debuggingf  s
   z.ChecklineTests.test_checkline_before_debuggingc                 C   s`   t tjd}|d W d    n1 sw   Y  t }|  | |tjdd d S r  )	rl   r   rM   rm   r5   r6   resetr~   r  r  r   r   r   test_checkline_after_resetl  s   z)ChecklineTests.test_checkline_after_resetc                 C   s   t d}ttjd}|| W d    n1 sw   Y  t| d }tt	  t
 }t|D ]}| |tj| q6W d    d S 1 sNw   Y  d S )Nz\
            # Comment
            """ docstring """
            ''' docstring '''

        rk   r   )rn   ro   rl   r   rM   rm   lenr   r   r   r5   r6   rangeZassertFalser  )r   r   rr   Z	num_linesr  linenor   r   r    test_checkline_is_not_executables  s   
"z/ChecklineTests.test_checkline_is_not_executableN)r   r   r   r  rN   r  r
  r  r   r   r   r   r   _  s    r   c                  G   s2   ddl m} ttttt|g}t|S )Nr   )test_pdb)	testr  unittestZ	makeSuiterI   r   doctestZDocTestSuiteZ	TestSuite)argsr  Zsuitesr   r   r   
load_tests  s   
r  __main__)Br  r_   r5   r   typesr   r  r[   rn   r  
contextlibr   r   ior   Ztest.supportr   Ztest.test_doctestr   Zunittest.mockr   r   r   r   r    r"   r#   r$   r%   r&   r)   r+   r,   r-   r.   r/   r0   r1   
ModuleTypemodexec__dict__r2   r3   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   ZTestCaserI   r   r  r   mainr   r   r   r   <module>   s|    jC_*2);>
+*@;8=7*,/*/    e%
