fix count when testing composite error output
don't color engine tracebacks in tests
py3: assign e so it survives outside the scope
shows entire session history when only startsess is given
added ~session/noline case to test_extract_hist_ranges()

- added ~10/ case, which is expected to yield (-10, 1, None)
added a missing comma
Merge pull request #2967 from joonro/history-previous-session-no-line

shows entire session history when only startsess is given
Merge pull request #2964 from minrk/testcount

fix count when testing composite error output

and a py3 fix in the same test