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
The Column class accepts a 'doc' argument. Use it.
And while we're at it, make them all unicode strings.
Performed by the following sed script:
s/info=dict(description=u\?\("[^"]*"\))/doc=u\1/
s/info=dict(description=u\?\('[^']*'\))/doc=u\1/
s/\(\s*\)info=dict(description=u\?\("[^"]*"\), /\1doc=u\2,\n\1info=dict(/
s/\(\s*\)info=dict(description=u\?\('[^']*'\), /\1doc=u\2,\n\1info=dict(/
/info=dict(description=u\?\('[^']*'\),$/ {
s//doc=u\1,/
n
s/^\s*/&info=dict(/
}
In previous gens, Spanish nature names only ever appeared in the
feminine form, so that's what we had. Now it looks like the isolated
nature names default to masculine — they're still feminine on the status
screen, but in the box you get "Naturaleza: [adjective]" and I guess
the adjective is considered to be on its own rather than modifying
naturaleza.
Italian doesn't follow suit so I guess it gets to be the one special
snowflake language where we don't have the default dictionary form for
natures.
I also changed Celebrate's effect to "unknown", which I meant to commit
separately but it got caught up in this one. It has a unique effect ID,
and we don't know for sure that it does nothing. Also, Splash's effect
(which it was sharing) says that the move is disabled by Gravity, which
isn't true of Celebrate.
I don't really like this but ehhhhhhh, the system for prose
translations seems to be to keep them in csv/translations/, and I can't
figure out how you're supposed to DO that, plus judging by the age of
the single file that's in there, that seems to be where translations go
to die.
Same as before, two commits for nicer diffs.
Also I don't think I ever mentioned, but the only missing items are
unused and spoiler items, so I never added them.
Also ALSO I remembered the U+200B ZERO WIDTH SPACE in the flavour
text for Thick Fat and the Adamant/Lustrous Orbs.
This is kind of arbitrary, but here's my reasoning:
- Japanese goes first, because it's the original language.
- ja-kanji and roomaji follow because obviously we don't want to split
Japanese up.
- Korean and Chinese go next to keep Asian languages together.
- Then English, because it's the main language other than Japanese.
- Then French and German, because they translate their Pokémon names???
idk it feels intuitive to me. Plus I guess their IDs are next.
- Then Spanish and Italian, because they're the only official languages
left.
- Czech goes last because it's unofficial.
Notes:
- I left all the flags surskitty added alone (powder, bite, pulse,
ballistics, and mental) because they don't seem to be in with the
other move flags. The only new flags are the Sky Battle one that I
added, and a mystery one, which I didn't add —
http://pastebin.com/K27Vk95J
- move_meta_* is a mess and I don't like it but X/Y seem to have all the
same move meta as B/W did so I updated it for the time being
- I didn't update effect_id because I'd have to sort out all the new
effects that I added manually and that sounds like a bigger endeavour
<Zhorken> I'd like to motion (again) that 0 and 1 power both be stored
as null
<Zhorken> and — or * be displayed based on damage class
<Zhorken> which is what determines 0 vs 1 anyway, with the arbitrary
who-fucking-cares exception of Me First
<eevee> the ayes have it
<Zhorken> awesome
<eevee> that's a good idea i don't remember its being motioned the
first time
<Zhorken> I definitely remember arguing it when B/W released
I reripped all the other languages, but Korean was the only one with any
mistakes or missing names.
I'll add all the other text later if nobody else does.
MySQL again. Indexed keys have a maximum length of 767 bytes and unicode
is stored as 3 bytes per character. Since 256*3 = 768, that pushes us
just past the limit. Could lower the length to 255 characters, but let's
go further - currently only names and identifers have a length limit,
and if a name or identifier doesn't fit in a terminal then i don't want
to see it.
Fixes issue #123.
In Whoosh 2.5, fields that can be sorted on need to specify
sortable=True or else take a large performance hit because whoosh
completely dumped its old method of speeding up sorting (automatic
caching) in favor of this brand new one.
These probably don't *all* need to be sortable, but hey.
Note that we now require Whoosh>=2.5 because the sortable keyword arg
didn't exist in exist in earlier versions.
This way it matches /all the other prose tables/. Relatedly, all the
abilities I recently expanded on had short_effect and effect swapped,
so I fixed that too.
We decided a while back to just give up and include these separately,
even though they're really just the English names. Now I actually need
them, because genus.
Showdown's data files said "Lock On" in a bunch of places, so I assumed
it had changed. I was wrong! Oops. Thanks to Chispy for confirming
that it hadn't.
I double-checked against http://wiki.ポケモン.com/wiki/ポケモン一覧 .
(Apologies for the likely-unclickable URL but it was really really long
otherwise.)
Flabébé was using hiragana べ instead of katakana ベ. Those were the
only hiragana in the csv.
I didn't add Competitive Milotic because Milotic is unobtainable in X/Y
until Bank comes out and as such we don't know if Competitive is its
second ability or if it replaced its hidden ability.
I skipped Flare Café and Team Flare HQ because I'm not convinced
they're real locations — the Café is just labelled part of Lumiose,
and Team Flare has two different HQs which may or may not be called
Team Flare HQ and I have no idea. They can get added later if
they're correct.
I'm kind of confused about these. These data (which I got from
Showdown, again) include egg groups for Carbink, which is genderless;
I have heard that the official guide lists egg groups, but then
Pumpkaboo and Gourgeist aren't listed as being in Grass, which is...
very suspicious. Hm.
TM100 might get mistaken for HM00, idk. Really there should just be an
is_hm column. I'd do it myself, but then I'd have to update
spline-pokedex too, and urgh.
We have way of figuring out IDs for Aerilate or Parental Bond, because
those abilities are only on Megas. I assumed they'd fit in the two-ID
gap and took a wild guess at order. (I put Parental Bond first
because Kangaskhan comes first.)
I defaulted to 1:1. As far as I know, while we may not know the exact
ratios for most new Pokémon, we do know that everything I just marked
1:1 comes in male and female.
Also, we need to split this into per-form for Meowstic's "forms".
Also also, wait, is gender_rate seriously not a foreign key? I spent a
good minute trying to figure out where the gender ratio enum table was.
Generation VI doesn't have a canonical pokedex (it has three). We don't
use this anywhere and as far as i can tell we never have. We can revive
it in another form if and when we find we need it.
Conflicts:
pokedex/data/csv/generations.csv
pokedex/db/tables.py
This commit originally included Basculin, too, but then magical dealt
with that before I pushed. Anyway, the query I used should have caught
any other similar cases, too:
insert into pokemon_moves select p.id, 14, pm.move_id, 2, 0, null from
pokemon_moves pm
join pokemon p on pm.pokemon_id=p.species_id and p.is_default=false
where pm.version_group_id=14 and pm.pokemon_move_method_id=2;
The join condition is cheating a little, but it does happen to work; it
joins a pokemon_move to all non-default forms of the same Pokémon. If
being default and having id=species_id didn't go hand-in-hand, I'm
pretty sure it'd require two joins to pokemon.
I'm assuming Normal Deoxys learns tutors based on Speed Deoxys's list,
given that Attack and Defense Deoxys have all the same tutors, and Speed
Deoxys has all those same tutors too while only gaining tutors unique to
Emerald. So in other words, it looks like Deoxys's Forme doesn't matter
for tutor compatibility in Gen III.
Notes:
- The removal of "Type" in ??? Arceus's French name follows all its
other types, even though ??? Arceus obviously doesn't appear in
Pokédex 3D Pro. (The English names do retain "Type".)
- Meloetta and Genesect are locked until passwords are revealed for
them. Meloetta is pretty unambiguously "Forme", but Genesect's forms
being named after their drives is still our (my) invention.
- Spiky-eared Pichu is also absent from Pokédex 3D, but I remember
having good reason for not including "Form" or anything. I just don't
don't remember what it was. Probably just that nothing's official,
afaik, and it's not really a "form" like the others, in that it's a
specific individual and a very small variation. "-eared" with a
lowercase "e" is definitely what the games say, though.
- I can put other foreign form names in later, although I won't know how
to do pokemon_name for other languages.
Also worth noting: I gave the alternate forms their respective moves
even though they technically learn them specifically in their default
forms. It seems weird to say that only one form gets the move,
especially when learning Secret Sword immediately causes Keldeo to /not/
be its default form. Also, Pirouette Meloetta already has TMs and other
tutors even though it's battle-only.
Note that "Form" isn't actaully official for Kyurem; it's just "Kyurem",
"Black Kyurem", and "White Kyurem", but we do the same with Rotom and
some other cases like this.
- Victory Road, Giant Chasm, and Reversal Mountain have unknown area
names. The others are hopefully accurate.
- Swarms are, again, not present. Neither are Hidden Grove encounters.
Most of the English names are official; the remaining few were
translated by Guested.
B/W 2 adds another Victory Road—this is a new location, distinct from
the previous one. The name remains the same, but our identifier is
unova-victory-road-2.