|
295 | 295 | ... |
296 | 296 | 16 |
297 | 297 |
|
298 | | -A different kind of crash:: |
| 298 | +A different kind of crash (also test printing of line continuation ``...:``, |
| 299 | +represented by ``<DOTSCOLON>`` below):: |
299 | 300 |
|
300 | | - sage: subprocess.call(["sage", "-t", "--warn-long", "0", # long time |
301 | | - ....: "--random-seed=0", "--optional=sage", "fail_and_die.rst"], **kwds) |
| 301 | + sage: # long time |
| 302 | + sage: proc = subprocess.run(["sage", "-t", "--warn-long", "0", |
| 303 | + ....: "--random-seed=0", "--optional=sage", "fail_and_die.rst"], **kwds, |
| 304 | + ....: stdout=subprocess.PIPE, text=True) |
| 305 | + sage: # the replacements are needed to avoid the strings being interpreted |
| 306 | + ....: # specially by the doctesting framework |
| 307 | + sage: print(proc.stdout.replace('sage:', 'sage<COLON>').replace('....:', '<DOTSCOLON>')) |
302 | 308 | Running doctests... |
303 | 309 | Doctesting 1 file. |
304 | 310 | sage -t --warn-long 0.0 --random-seed=0 fail_and_die.rst |
305 | 311 | ********************************************************************** |
306 | | - File "fail_and_die.rst", line 5, in sage.doctest.tests.fail_and_die |
| 312 | + File "fail_and_die.rst", line 8, in sage.doctest.tests.fail_and_die |
307 | 313 | Failed example: |
308 | 314 | this_gives_a_NameError |
309 | 315 | Exception raised: |
|
313 | 319 | Killed due to kill signal |
314 | 320 | ********************************************************************** |
315 | 321 | Tests run before process (pid=...) failed: |
316 | | - ... |
| 322 | + sage<COLON> import time, signal ## line 4 ## |
| 323 | + sage<COLON> print(1, |
| 324 | + <DOTSCOLON> 2) ## line 5 ## |
| 325 | + 1 2 |
| 326 | + sage<COLON> this_gives_a_NameError ## line 8 ## |
| 327 | + sage<COLON> os.kill(os.getpid(), signal.SIGKILL) ## line 9 ## |
| 328 | + ********************************************************************** |
317 | 329 | ---------------------------------------------------------------------- |
318 | 330 | sage -t --warn-long 0.0 --random-seed=0 fail_and_die.rst # Killed due to kill signal |
319 | 331 | ---------------------------------------------------------------------- |
320 | 332 | ... |
| 333 | + sage: proc.returncode |
321 | 334 | 16 |
322 | 335 |
|
323 | 336 | Test that ``sig_on_count`` is checked correctly:: |
|
0 commit comments