[py-dev] new resource API nearing completion including impl
Floris Bruynooghe
flub at devork.be
Thu Aug 2 14:50:50 CEST 2012
On 2 August 2012 11:44, holger krekel <holger at merlinux.eu> wrote:
> http://pytest.org/dev/setup.html
>
> Hope the latter begins to make more sense.
Yes, it does. I now see the power @setup. One thing you might want
to add is compare the module-global setting to simply using the
"global" statement inside the setup function.
Btw, is it a bug in the assertion that when using a global variable
the assert-printing does not seem to show the value of that global
variable?
> I still intend to refine docs and add more examples but now is lunch and
> then child-care summer party time :)
I hope you're having a better summer to party in then the torrential
rain we seem to be getting this afternoon ;-)
> I also uploaded a new package pytest-2.3.0.dev8 to be installed
> via:
>
> pip install -i http://pypi.testrun.org -U pytest
I was playing with this over lunch and discovered this doesn't work:
@pytest.factory(scope='session')
def pytest_funcarg__foo():
return 42
Would it not make sense to allow this (or at least provide a clearer
error)? I still like that form because of the grep-ability (doing a
2-line grep is much harder and would still not cover ppl doing "from
pytest import factory" etc).
Also doing this results in setup_module being called twice:
@pytest.setup(scope='module')
def setup_module():
print 'setting up module'
I'm not sure what the correct behaviour should be here.
Regards,
Floris
More information about the Pytest-dev
mailing list