mitsuhiko/markupsafe — pull request #6 by bukzor (2012-05-15 21:54:05+00:00)
Title: tests for subclassing Markup, overriding escape

In our application we'd like to subclass Markup to handle encoded strings more naturally.
Currently this isn't possible.

I've done the minimum change to allow this, and added tests to show that it works.
All tests pass and benchmarks look fine.

```
Before:
--------------------------------------------------------------------------------
basic 100000 loops, best of 3: 5.2 usec per loop
largestring 1000 loops, best of 3: 917 usec per loop
long_empty_string 10000 loops, best of 3: 129 usec per loop
long_suffix 100 loops, best of 3: 2.71 msec per loop
short_empty_string 100000 loops, best of 3: 4.71 usec per loop
--------------------------------------------------------------------------------
After:
--------------------------------------------------------------------------------
basic 100000 loops, best of 3: 5.17 usec per loop
largestring 1000 loops, best of 3: 919 usec per loop
long_empty_string 10000 loops, best of 3: 129 usec per loop
long_suffix 100 loops, best of 3: 2.73 msec per loop
short_empty_string 100000 loops, best of 3: 4.65 usec per loop
--------------------------------------------------------------------------------
```