Show More
@@ -0,0 +1,35 b'' | |||||
|
1 | """Tests for debugging machinery. | |||
|
2 | """ | |||
|
3 | #----------------------------------------------------------------------------- | |||
|
4 | # Copyright (c) 2012, The IPython Development Team. | |||
|
5 | # | |||
|
6 | # Distributed under the terms of the Modified BSD License. | |||
|
7 | # | |||
|
8 | # The full license is in the file COPYING.txt, distributed with this software. | |||
|
9 | #----------------------------------------------------------------------------- | |||
|
10 | ||||
|
11 | #----------------------------------------------------------------------------- | |||
|
12 | # Imports | |||
|
13 | #----------------------------------------------------------------------------- | |||
|
14 | ||||
|
15 | # third-party | |||
|
16 | import nose.tools as nt | |||
|
17 | ||||
|
18 | # Our own | |||
|
19 | from IPython.core import debugger | |||
|
20 | ||||
|
21 | #----------------------------------------------------------------------------- | |||
|
22 | # Tests | |||
|
23 | #----------------------------------------------------------------------------- | |||
|
24 | ||||
|
25 | def test_longer_repr(): | |||
|
26 | from repr import repr as trepr | |||
|
27 | ||||
|
28 | a = '1234567890'* 7 | |||
|
29 | ar = "'1234567890123456789012345678901234567890123456789012345678901234567890'" | |||
|
30 | a_trunc = "'123456789012...8901234567890'" | |||
|
31 | nt.assert_equals(trepr(a), a_trunc) | |||
|
32 | # The creation of our tracer modifies the repr module's repr function | |||
|
33 | # in-place, since that global is used directly by the stdlib's pdb module. | |||
|
34 | t = debugger.Tracer() | |||
|
35 | nt.assert_equals(trepr(a), ar) |
General Comments 0
You need to be logged in to leave comments.
Login now