[py-dev] Upgrading from pytest 1.3.2 to 2.0 - computed conftest options

holger krekel holger at merlinux.eu
Tue Dec 7 12:31:27 CET 2010


Hi Andy,

On Mon, Dec 06, 2010 at 16:20 -0500, Andy Fundinger wrote:
> I'm trying to upgrade from py.test 1.3.2 to 2.0 but I'm running into 
> issues with my use of the old style conftest.py feature to specify 
> options.  I specify options like:
> 
> 
> option_cov_branch = True 
> 
> option_cov_data_file = os.path.join(os.environ["PROJECT_ROOT"],"testCovFile%d.log"%random.randint(0,100000))
> 
> option_tx = ["popen//python=python",]*multiprocessing.cpu_count()
> 
> 
> the computed ones are a problem as the new .ini files can't take them 
> and the conftest.py file specification seems to be ignored.  Is there a 
> particular hook that I can grab and add/change config values early 
> enough to affect all plugins?

Indeed a feature regression.  I just added a new pytest_cmdline_processargs
hook to accomodate the situation.  The basic idea is to add command line 
arguments before option parsing takes place.  It is only called on the 
master.  The slaves do not call this hook.  

It's not released yet but you can see an example in the upcoming docs here:

    http://pytest.org/2.0.1dev/example/simple.html#dynamically-adding-command-line-options

and install the the development version with::

    pip install -i http://pypi.testrun.org -U pytest

Let me know of any issues.  A note already though: i think the pytest-cov plugin 
does not provide the options you use above.  Instead it uses/allows to point
to a .coveragerc file.  I believe it also cares for coverage data filenames
itself.

cheers,
holger
 
> 
> 
> 
> Regards,
> 
> Andy Fundinger
> 
> Risk Focus Inc.
> 424.243.6227
> 
> 
> New York  Office: +1 917 725 6006  Fax: +1 917 591 1616
> 
> London  Office: +44 (0) 207 760 7184  Fax: +44 (0) 207 691 7165
> _______________________________________________
> py-dev mailing list
> py-dev at codespeak.net
> http://codespeak.net/mailman/listinfo/py-dev


-- 



More information about the Pytest-dev mailing list