`bin/py.test` runs the js.jquery_tooltip, js.jquery and fanstatic
tests. The fanstatic tests fail, because the foo package from the
fanstatic buildout is not available:
I try to exclude testing the js.jquery and fanstatic packages:
`bin/py.test js` runs the tests in the `js` directory only. We get the
following error:
`bin/py.test --ignore=src` is going to ignore the `src` directory,
where the `js.jquery` and `fanstatic` checkouts live. I get the same
error as above:
Looks like the library_registry kicks in before the entry point is loaded.
Any ideas?
JJ
Right, I think this is the correct thing to do: pypy finds tests even in
stuff checked out by mr.developer, but we don't want to run them when
we're testing js.jquery_tooltip.
> `bin/py.test js` runs the tests in the `js` directory only. We get the
> following error:
>
> http://pastie.org/1368162
>
> `bin/py.test --ignore=src` is going to ignore the `src` directory,
> where the `js.jquery` and `fanstatic` checkouts live. I get the same
> error as above:
>
> http://pastie.org/1368168
>
> Looks like the library_registry kicks in before the entry point is loaded.
>
> Any ideas?
Looks like my entry point approach is leading to problems. I've altered
Fanstatic so that you need to call get_library_registry() to get the
global library registry to defer the entry point getting mechanism to
later during the initialization process. This fixes the tests.
Just running plain py.test fails still though, as some fanstatic tests
fail due to the missing MyPackage, as you had too. This problem would
decrease once we do a release of fanstatic and we can stop using
mr.developer here. Still, it's annoying.
If someone would want to look into it, we could investigate whether we
can put some tests in a different category with py.test, and the run
those *only* when you are testing Fanstatic itself, or something like
that. Or alternatively we could hide the test when MyPackage cannot be
imported.
Regards,
Martijn
[1] describes how to pass this information to setup.cfg. Is this the
way to go? If so, I will apply it to all packages.
>> `bin/py.test js` runs the tests in the `js` directory only. We get the
>> following error:
>>
>> http://pastie.org/1368162
>>
>> `bin/py.test --ignore=src` is going to ignore the `src` directory,
>> where the `js.jquery` and `fanstatic` checkouts live. I get the same
>> error as above:
>>
>> http://pastie.org/1368168
>>
>> Looks like the library_registry kicks in before the entry point is loaded.
>>
>> Any ideas?
>
> Looks like my entry point approach is leading to problems. I've altered
> Fanstatic so that you need to call get_library_registry() to get the global
> library registry to defer the entry point getting mechanism to later during
> the initialization process. This fixes the tests.
>
> Just running plain py.test fails still though, as some fanstatic tests fail
> due to the missing MyPackage, as you had too. This problem would decrease
> once we do a release of fanstatic and we can stop using mr.developer here.
> Still, it's annoying.
>
> If someone would want to look into it, we could investigate whether we can
> put some tests in a different category with py.test, and the run those
> *only* when you are testing Fanstatic itself, or something like that. Or
> alternatively we could hide the test when MyPackage cannot be imported.
I fixed the 'mypackage' related failure in [2] using the pytest
skipping on missing import functionality [3].
> Regards,
>
> Martijn
1) http://pytest.org/example/pythoncollection.html#changing-directory-recursion
2) https://bitbucket.org/fanstatic/fanstatic/changeset/08ba03992f63
3) http://pytest.org/skipping.html#skipping-on-a-missing-import-dependency
Sure, if it works, sounds good!
[snip]
> I fixed the 'mypackage' related failure in [2] using the pytest
> skipping on missing import functionality [3].
I'm not sure whether we need to do this now that you uncovered [1], but
I guess it can't hurt! py.test does have lovely features, doesn't it? :)
Regards,
Martijn
Done!
> [snip]
>>
>> I fixed the 'mypackage' related failure in [2] using the pytest
>> skipping on missing import functionality [3].
>
> I'm not sure whether we need to do this now that you uncovered [1], but I
> guess it can't hurt! py.test does have lovely features, doesn't it? :)
I am going to leave the skip-on-missing-mypackage-import in there,
because one day fanstatic may be part of a compattest, in which
mypackge may have not been set up.
Py.test indeed has lovely features.
> Regards,
>
> Martijn