Merge lp:~andrea-crotti-0/mailman/py_interactive into lp:mailman

Proposed by Andrea Crotti on 2012-03-15
Status: Merged
Approved by: Barry Warsaw on 2012-04-06
Approved revision: 7108
Merged at revision: 7145
Proposed branch: lp:~andrea-crotti-0/mailman/py_interactive
Merge into: lp:mailman
Diff against target: 14 lines (+2/-2)
1 file modified
src/mailman/commands/cli_withlist.py (+2/-2)
To merge this branch: bzr merge lp:~andrea-crotti-0/mailman/py_interactive
Reviewer Review Type Date Requested Status
Barry Warsaw 2012-03-15 Approve on 2012-04-06
Review via email: mp+97741@code.launchpad.net

Description of the change

There is a tiny change from the version already merged, because now sys.ps1 is set correctly even if readline/rlcompleter fail..

Not sure what's the best way to proceed but I guess that reproposing to merge after the commit should be the right way.

To post a comment you must log in.
Barry Warsaw (barry) wrote :

I'll remove the extra blank line and merge this branch. Thanks!

Do you have any other thoughts on how to test this?

review: Approve
Andrea Crotti (andrea-crotti-0) wrote :

Ok good..
The only way I could find to test this thing is to
- mock the environment making IPython available or not
- mock IPython and the python interpreter and check that they are called as expected

This would probably work, but I don't really think it would really add any value, what do you think?

Barry Warsaw (barry) wrote :

On Apr 7, 2012, at 2:44 AM, Andrea Crotti wrote:

> Ok good..
> The only way I could find to test this thing is to
> - mock the environment making IPython available or not
> - mock IPython and the python interpreter and check that they are called as expected

mock is now a dependency (I needed it for the NNTPRunner tests), so this would be doable.

> This would probably work, but I don't really think it would really add any value, what do you think?

Well, untested code is broken code. :)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/mailman/commands/cli_withlist.py'
2--- src/mailman/commands/cli_withlist.py 2012-03-14 04:09:33 +0000
3+++ src/mailman/commands/cli_withlist.py 2012-03-15 19:57:22 +0000
4@@ -172,8 +172,8 @@
5 readline.parse_and_bind('tab: complete')
6 except ImportError:
7 pass
8- else:
9- sys.ps1 = config.shell.prompt + ' '
10+
11+ sys.ps1 = config.shell.prompt + ' '
12 interact(upframe=False, banner=banner, overrides=overrides)
13
14 def _details(self):