Closed davidszotten closed 6 years ago
The message is a bit misleading because it does call out to the class and then it filters by the method name. This is because py.test
doesn't have support for parametrized test methods using the 'path/to/test.py::TestClass::test_method
Do you have unexpected execution of the parametrized test? Or does it execute and you are just worried about the message? Does :Pytest session
look ok/expected ?
If this is about the messaging, I could improve it a bit I think, to signal that it is working with a parametrized method.
hey, thanks for the quick reply. and apologies if i wasn't clear: the point is that the test isn't parametrized at all, that's a regular pytest mark
Ouch. Of course. We are being naive trying to detect this. I can get a fix so you can try it out in a bit, thanks for clarifying!
thank you!
@davidszotten can you try a7abab2622021ca657f01fe4b5dce91dcafb39ee and tell me if that fixes this for you? I can then merge to master and hopefully close this ticket :)
yes, this seems to fix the issue
i don't quite follow why parametrized functions need special handling, from what i see they can be invoked just like non-parametrized ones
This is because py.test
can't use the notation of /path/test_file.py::TestClass:test_method
when test_method
is parametrized. I think this is because internally py.test
is having signature for each parametrized execution.
That is why we use -k
in this case, to specify up to the class, and then filter the test method with -k
Thanks for reporting this! Will push this to master
This is the issue I reported a while back https://github.com/pytest-dev/pytest/issues/649
Seems to have been fixed recently, but I have to supported older versions of py.test
so this has workaround has to stay for now
ah yes. looks like it was fixed in 2.9.1 (2016-03-17)
anyway. thanks for the fix for my current issue!
Hi,
i have something like
when running
Pytest method
i getpy.test ==> Running test for parametrized method test_method
but it actually tries to run'path/to/file.py'::TestClass