Merge lp:~maxb/launchpad/ignored-asserts into lp:launchpad
| Status: | Merged |
|---|---|
| Merged at revision: | not available |
| Proposed branch: | lp:~maxb/launchpad/ignored-asserts |
| Merge into: | lp:launchpad |
| Diff against target: |
99 lines (+21/-8) 5 files modified
lib/lp/soyuz/doc/initialise-from-parent.txt (+13/-0) lib/lp/translations/model/translatablemessage.py (+1/-1) lib/lp/translations/utilities/rosettastats.py (+1/-1) lib/lp/translations/utilities/translation_import.py (+2/-2) scripts/ftpmaster-tools/initialise-from-parent.py (+4/-4) |
| To merge this branch: | bzr merge lp:~maxb/launchpad/ignored-asserts |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Abel Deuring (community) | code | Approve on 2010-04-09 | |
| Graham Binns (community) | code | 2010-02-08 | Needs Fixing on 2010-02-09 |
|
Review via email:
|
|||
Commit Message
Fix assert statements which were not being tested owing to misplaced parentheses.
| Max Bowsher (maxb) wrote : | # |
| Max Bowsher (maxb) wrote : | # |
AssertionError: Parent must not have PENDING builds is triggering in lib/lp/
| Graham Binns (gmb) wrote : | # |
Hi Max,
Nice catch! I like it. You should add this check to bin/lint.sh so that make lint will pick up this error for us.
I'm marking this needs fixing but only because I want the change to the linter in there as well.
| Max Bowsher (maxb) wrote : | # |
> Nice catch! I like it. You should add this check to bin/lint.sh so that make
> lint will pick up this error for us.
Graham,
Are you sure you really want bin/lint.sh to depend on having a python2.6 installed?
In any case, once Launchpad properly migrates to Python 2.6 in the future, Python itself will be linting this.
Though, I guess this is "Needs fixing" anyway, since we need to resolve that Soyuz test failure before this branch can land. Should we aim to fix the soyuz test first, or to land this branch with the soyuz asserts commented out and XXXed?
| Graham Binns (gmb) wrote : | # |
On 9 February 2010 11:26, Max Bowsher <email address hidden> wrote:
>> Nice catch! I like it. You should add this check to bin/lint.sh so that make
>> lint will pick up this error for us.
>
> Graham,
>
> Are you sure you really want bin/lint.sh to depend on having a python2.6 installed?
>
Ah, good point. I forget sometimes that not everyone runs on Karmic.
However, we could have a conditional that runs the check if 2.6 is
available.
> In any case, once Launchpad properly migrates to Python 2.6 in the future, Python itself will be linting this.
>
True. Do we have a timetable for that? All the ML threads I've seen
are vague about it.
> Though, I guess this is "Needs fixing" anyway, since we need to resolve that Soyuz test failure before this branch can land. Should we aim to fix the soyuz test first, or to land this branch with the soyuz asserts commented out and XXXed?
We should fix the test, certainly. If the test is very broken, you
should speak to Julian about it.
| Max Bowsher (maxb) wrote : | # |
> On 9 February 2010 11:26, Max Bowsher wrote:
> >> Nice catch! I like it. You should add this check to bin/lint.sh so that
> >> make lint will pick up this error for us.
> >
> > Are you sure you really want bin/lint.sh to depend on having a python2.6
> > installed?
>
> Ah, good point. I forget sometimes that not everyone runs on Karmic.
> However, we could have a conditional that runs the check if 2.6 is
> available.
>
> > In any case, once Launchpad properly migrates to Python 2.6 in the future,
> > Python itself will be linting this.
>
> True. Do we have a timetable for that? All the ML threads I've seen
> are vague about it.
Let's not bother with adding anything to lint.sh, since the Python 2.6 migration seems to be getting under way with Salgado doing some work on it, and the impending release of Lucid means it will become a high priority.
> > Though, I guess this is "Needs fixing" anyway, since we need to resolve that
> > Soyuz test failure before this branch can land. Should we aim to fix the soyuz
> > test first, or to land this branch with the soyuz asserts commented out and
> > XXXed?
>
> We should fix the test, certainly. If the test is very broken, you
> should speak to Julian about it.
I have now fixed the test, thanks to guidance from wgrant.
Ready for re-review and landing.

The Python assert statement is not a function, and treating it as such - i.e.:
assert (a == b, "The things weren't equal!")
results in evaluating a 2-element tuple as a boolean, thus, it's approximately the same as 'assert True', i.e. a no-op.
Python 2.6 recognizes this flaw, and adds a SyntaxWarning to report this case. Thus, by running:
find -name \*.py -type f | xargs python2.6 -m py_compile
I've located all instances of the problem in the Launchpad source.
Here's a branch applying the requisite syntax fixes.