Merge lp:~jameinel/loggerhead/pygment-annotate-fail into lp:loggerhead
Proposed by
John A Meinel
Status: | Merged |
---|---|
Merged at revision: | 427 |
Proposed branch: | lp:~jameinel/loggerhead/pygment-annotate-fail |
Merge into: | lp:loggerhead |
Diff against target: |
51 lines (+19/-4) 1 file modified
loggerhead/tests/test_simple.py (+19/-4) |
To merge this branch: | bzr merge lp:~jameinel/loggerhead/pygment-annotate-fail |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Brad Crittenden (community) | code | Approve | |
Benji York (community) | code* | Approve | |
Review via email: mp+49312@code.launchpad.net |
Commit message
Fix an "annotate" test that fails when pygments is installed.
Description of the change
I was running the test suite on another machine, and it seems having pygments installed causes on of the annotate tests to fail.
The point of the test was to assert that we properly escape the file content on the annotate page. It was doing so by making sure the text "with<
So this changes it to just use a regex that can match either way. I've tested it on both machines, and the test still passes.
To post a comment you must log in.
The "with.* <.*htmlspeci alchars" regex feels a bit too liberal. How
about something like this?
# remove any pygments-inserted tags assertContains( body, "with< htmlspecialchar s")
body = re.sub('<[^>]+>', '', res.body)
self.
Also, I suspect judicious use of a clean Python and buildout would help
with this scenario, providing reproducible builds isolated from the
environment. If you're interested I'd be glad to help craft a buildout
for the project.
Regardless, the branch is certainly approvable as is, so I've done so.
Note that this is a mentored review so Brad will be reviewing my review
and giving the final approval.