__test__ needs to be checked for methods of a class too. Earlier,
this was not done, and all methods in a class was assumed to be
a test. This commit adds the appropriate condition to ensure that
if the __test__ is set to False, it does not collect that method.
Fixes https://github.com/pytest-dev/pytest/issues/1558
The commit allow users to add a properties node in testsuite level see
example below:
<testsuite errors="0" failures="0" name="pytest" skips="1" tests="1"
time="11.824">
<properties>
<property name="ARCH" value="PPC"/>
<property name="OS" value="RHEL 7.2"/>
<property name="TestPlanURL" value="https://url.."/>
<property name="Automated" value="True"/>
</properties>
<testcase classname="git.....>
</testcase>
</testsuite>
The current situation is that properties node can be added to every
testcase node. However, sometimes we need some global properties that
applies to all testcases and give better description for the testsuite
itself.
When defining a fixture in the same module as where it is used, the
function argument shadows the fixture name, which a) annoys pylint and
b) can lead to bugs where you forget to request a fixture into a test
method.
This allows one to define fixtures with a different name than the name
of the function, bypassing that problem.
a more descriptive docstring (the workaround itself is just to import
readline earlier). I removed the conditional on targetfd from the
workaround since it doesn't really matter.
* Added # noqa marker.
* Added changelog entry, and self to authors.
Fixes issue 331
previously to this change the collection code would issue a warning for
when ever it encountered a variable that looked like a test but wasn't a
function saying that it wouldn't collect it because it wasn't a function.
This fixes the logic so that if that warning is issued it really isn't
collected.
However previously special cases existed to support tests that were
created using functools.wraps and functools.partial. So the condition for
issuing that warning has been updated to take that in to account
Also try the old way of detecting functions just for proper integration
with mock.path in python 2.7 the get_real_func returned the unbound method