[py-dev] Help understanding pytest_generate_tests related error message

Ronny Pfannschmidt Ronny.Pfannschmidt at gmx.de
Fri Apr 29 22:25:04 CEST 2011


On Fri, 2011-04-29 at 22:18 +0200, Baptiste Lepilleur wrote:
> 2011/4/29 Ronny Pfannschmidt <Ronny.Pfannschmidt at gmx.de>
>         
>         [...]
>         > E                   Failed: funcarg 'property' not used in
>         this
>         > function.
>         [...]
>         it seems the function is test_property_validation
>         the current check for the metafunc funcarg dict does not
>         consider
>         arguments with default values funcargs
>         thus it complains since you pass in something that has a
>         default at the
>         function level
> 
> 
> It was indeed the cause. Changing:
> def test_property_validation( validation_scenario_iter, property=None,
> value=None, good_value=None ):
> 
> 
> to:
> 
> 
> def test_property_validation( validation_scenario_iter, property,
> value, good_value ):
> 
> 
> fixed the issue. This is weird as it used to work in 1.3.4...
>  
>         >
>         > Source of the test module can be found
>         > there: http://pastebin.com/1D2VArGt
>         >
>         
>         
>         i would like to suggest splitting the scenario types into
>         multiple test
>         functions, (good/bad values/types)
>         
> 
> 
> I'm not sure how I would go about that: it would means going through
> the VALIDATION_SCENARIOS test data for each test function, and
> duplicating some setup code of the test function...

unless i'm misstaken, only the creation of the class is shared
which means that could actually be something like a funcarg or a param
to a funcarg

-- Ronny
> 
> 
>          also giving names/id's to the scenarios 
> I did not know it was possible to give name. I added this and it
> greatly improve the output!
> 
> 
> Thanks a lot for helping figuring this out,
> Baptiste.
> 
> 
> _______________________________________________
> py-dev mailing list
> py-dev at codespeak.net
> http://codespeak.net/mailman/listinfo/py-dev

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://mail.python.org/pipermail/pytest-dev/attachments/20110429/1b93bac9/attachment.pgp>


More information about the Pytest-dev mailing list