[TIP] Tasting the Cheeseshop
holger krekel
holger at merlinux.eu
Fri Oct 21 01:48:04 PDT 2011
On Thu, Oct 20, 2011 at 13:36 -0400, Barry Warsaw wrote:
> On Oct 18, 2011, at 05:55 AM, holger krekel wrote:
>
> >I think it makes most sense to avoid relying on setup.py - with
> >tox you can have "python setup.py test" as your test command which
> >works fine. If we want to test pypi packages that don't
> >have a tox.ini (or setup.cfg) then we could try heuristics to
> >create tox.ini files like "python setup.py test" and generate
> >test environments based on the TROVE identifiers (python/python3).
>
> Creating that set of heuristics is I think a bit tricky, but maybe we can do
> something useful here.
agreed, it's tricky. Maybe we could have a public repo where heuristic config
files for testing are stored and can be manually modified/maintained.
Authors can choose to have their own tox.ini.
> One thing that would be helpful is if tox supported some kind of "stack" of
> ini files. For example, I might have a project with a tox.ini that looks like
> this:
>
> -----tox.ini
> [tox]
> envlist = py26,py27,py32,py33
>
> [testenv]
> commands=python setup.py test -vv
>
> [testenv:py33]
> # Python 3.3 isn't released yet, so use a local build from the hg branch.
> basepython=/home/users/py33/bin/python3
> -----tox.init
>
> But on the test machine, testenv:py33 won't be appropriate and I might need to
> add a testenv:py32 to pick up an unreleased patched version of Python 3.2.
>
> Right now I've been thinking about just parsing the config file, merging it
> with some "system settings" and then writing it back out again, but that's not
> idea. (Nor is what I currently do, which is punt if a tox.ini is found. ;)
Good point. Maybe an environment specific file for storing Python information
(and possibly other per-environment information) would help? If possible
i'd separate config concerns rather than introduce "stacking" or overlay
config values, easier for debugging etc.
best,
holger
More information about the testing-in-python
mailing list