File: test.py

package info (click to toggle)
alire 1.2.1-2.1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 13,124 kB
  • sloc: ada: 77,497; python: 6,605; sh: 477; ansic: 347; makefile: 258; javascript: 87; xml: 40
file content (31 lines) | stat: -rw-r--r-- 922 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
"""
Test that -d/--debug enable dumping of unexpected exceptions
"""

import os

from drivers.alr import prepare_env, prepare_indexes, run_alr
from drivers.asserts import assert_eq, assert_match


def check_output(dump):
    assert_match(
	'''stderr: PROGRAM_ERROR
stderr: Raising forcibly
stderr: raised PROGRAM_ERROR : Raising forcibly.*
''', dump)


# Check debug dump (we intentionally disable debug flag in run_alr)
check_output(run_alr('-d', 'dev', '--raise',
                     debug=False, complain_on_error=False).out)
# Long flag version
check_output(run_alr('--debug', 'dev', '--raise',
                     debug=False, complain_on_error=False).out)

# Check ordinary non-debug output:
assert_eq(run_alr('dev', '--raise', debug=False, complain_on_error=False).out,
          "ERROR: Raising forcibly\n"
          "ERROR: alr encountered an unexpected error, re-run with -d for details.\n")

print('SUCCESS')