Merge lp:~mbp/bzr/scripts into lp:bzr
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | John A Meinel | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 5476 | ||||
Proposed branch: | lp:~mbp/bzr/scripts | ||||
Merge into: | lp:bzr | ||||
Diff against target: |
582 lines (+167/-86) 11 files modified
NEWS (+4/-0) bzrlib/commands.py (+6/-1) bzrlib/tests/__init__.py (+4/-0) bzrlib/tests/blackbox/test_bound_branches.py (+3/-0) bzrlib/tests/blackbox/test_dpush.py (+2/-0) bzrlib/tests/blackbox/test_shelve.py (+8/-0) bzrlib/tests/script.py (+18/-8) bzrlib/tests/test_conflicts.py (+73/-73) bzrlib/tests/test_delta.py (+1/-2) bzrlib/tests/test_script.py (+42/-2) doc/developers/testing.txt (+6/-0) |
||||
To merge this branch: | bzr merge lp:~mbp/bzr/scripts | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
John A Meinel | Approve | ||
Vincent Ladeuil | Needs Fixing | ||
Review via email: mp+35386@code.launchpad.net |
Commit message
empty output in shell-like tests is no longer a wildcard
Description of the change
This changes the scriptrunner behaviour so that
"""
$ echo foo
"""
will fail, because it asserts echo doesn't produce output.
I think this is less confusing. If you want to allow for a command that might produce output but you don't care, you can say '...'. It's also more consistent with regular doctest.
This is going to put on a slight extra burden that you need to think about commands that may produce output, and if we change a command that is initially silent to produce output, we may need to update a bunch of tests. However I think this is much safer than not letting people check things actually are silent.
test_resolve is a bit messy, but I think it's actually better after the changes: more clear about which bits it actually is or isn't testing, and it points out the usefulness of -q when you don't want to see the output for a particular command.
I agree, having the test writer think about -q and '...' sounds like a good plan.
The only drawback I could think of is that it will require a bit more expertise
than a mere copy/paste. No big loss here, I'm still waiting for bug reporters to
do that anyway :-D
127 - test_case. assertEqualDiff (expected, actual) assertEquals( expected, actual)
128 + test_case.
Why ??? EqualDiff provides valuable info, please don't remove that !