This commit updates the tests to take advantage of some of py.test's
newer features. Requires py.test 2.3 or newer. Tested with 2.3.0 and
2.5.2.
Tests which were parametrized now use py.test's built-in
parametrization[1].
The session and lookup objects are now implemented as fixtures[2].
The media root is a fixture as well. Fixtures are automatically passed
to any function that expects them.
Since the session is now created in one place, it is now possible to
provide an engine URI on the command line when running py.test. Ditto
for the index directory. (But the environment variables still work of
course.)
Slow tests are now marked as such and not run unless the --all option is
given.
A couple media tests are marked as xfail (expected to fail) because they
are broken.
[1]: http://pytest.org/latest/parametrize.html
[2]: http://pytest.org/latest/fixture.html
No reason to instantiate every time as_html's called, is there?
Also, sessions use a markdown_extension attribute instead of
markdown_extension_class. The latter is only used to set the former when
the session is created (unless another markdown_extension_class is given,
of course).
Links such as []{pokemon:mewthree} can come from users, so they should not
crash the parser.
So, when an object is not found (or more than one is found), call
identifier_url() directly, instead of failing to get the object for
object_url(). Essentially, treat the link as having an unknown category
(like mechanic:, currently).
The test that check the pokédex descriptions updated so that only
links to known objects and "mechanic:" are allowed.
Linked-to objects aren't required to have identifiers now, so object_url()
in custom extensions might need to be changed.
The one in the test did, for example.
Previously, every single spline-pokedex request tacked another markdown
extension onto a global list in spline, making markdown processing just
a little bit slower over time. This is terrible.
Now we do something a little less crazy and a little more global. Wait,
is that less crazy or more?
- the Session has a `pokedex_link_maker` property, whose `object_url`
method is used to make URLs in Markdown
- pokemon.names_table.name is now an ordinary Unicode column
- pokemon.name is a MarkdownString that is aware of the session and the
language the string is in
- pokemon.name_map is a dict-like association_proxy of the above
- move.effect works similarly, with transparent $effect_chance substitution
as before