Commit graph

7 commits

Author SHA1 Message Date
Andrew Ekstedt
0094e9584c Modernize our use of py.test
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
2014-07-06 21:45:05 -07:00
Andrew Ekstedt
14d9b6ead7 Fix test_media.py.
- Add --media-root option (was half-supported already, but not accepted
  on the command line).

- Don't test for Colosseum and XD graphics, since we have none.

- Acknowledge *-beta sprites.
2012-03-16 12:37:47 -07:00
Petr Viktorin
332647c362 Switch to py.test #604 2011-05-06 12:40:44 +03:00
Petr Viktorin
c710457717 Pokemon species split: media accessors 2011-05-06 12:26:17 +03:00
Petr Viktorin
ab2baaa759 Update media accessors wrt repo split
All accessors now take a `root` arg, the root of the media tree.
Alternatively `root` can be a custom MediaFile subclass, which should allow
neat tricks like:
- Checking some kind of manifest to prevent stat() calls
- Custom properties of the file objects (e.g. for HTML <img> tags)
- Downloading the media on demand

Tests assume media is at pokedex/data/media, skip otherwise.
2011-05-06 12:26:17 +03:00
Eevee
b2db58afc7 Fix discrepancy between media-accessors branches. 2011-04-17 22:35:24 -07:00
Petr Viktorin
7292ede94a Test media accessors, and the media organization itself
A few tests of the accessors, along with a very dumb, long-running script
to ensure everything is in its proper place, and there's nothing but the
proper things.

For now it still finds some beta form cruft for Burmy, Pichu and Cherrim.
2011-04-17 20:55:58 -07:00