File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed
numba_dpex/tests/debugging Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change 66
77import pytest
88
9+ from .gdb import gdb
10+
911
1012@pytest .fixture
1113def app ():
12- from .gdb import gdb
14+ g = gdb ()
15+
16+ yield g
1317
14- return gdb ()
18+ g . teardown_gdb ()
Original file line number Diff line number Diff line change @@ -24,9 +24,6 @@ def __init__(self):
2424 self .spawn ()
2525 self .setup_gdb ()
2626
27- def __del__ (self ):
28- self .teardown_gdb ()
29-
3027 def spawn (self ):
3128 env = os .environ .copy ()
3229 env ["NUMBA_OPT" ] = "0"
@@ -50,8 +47,10 @@ def teardown_gdb(self):
5047 self .child .sendintr ()
5148 self .child .expect ("(gdb)" , timeout = 5 )
5249 self .child .sendline ("quit" )
53- self .child .expect ("Quit anyway?" , timeout = 5 )
54- self .child .sendline ("y" )
50+ # We want to force quit only if program did not do it itself.
51+ index = self .child .expect (["Quit anyway?" , pexpect .EOF ], timeout = 5 )
52+ if index == 0 :
53+ self .child .sendline ("y" )
5554
5655 def _command (self , command ):
5756 self .child .expect ("(gdb)" , timeout = 5 )
You can’t perform that action at this time.
0 commit comments