Opened 7 years ago

Last modified 7 years ago

#6352 enhancement new

Document trial's handling of `skip`.

Reported by: Tom Prince Owned by:
Priority: normal Milestone:
Component: trial Keywords: documentation
Cc: Jonathan Lange Branch:
Author:

Description

SynchronousTestCase documents a skip attribute and getSkip method from which one may be able to deduce how tests can get skipped, but it isn't explicit.

The trial howto should document this explicitly, as should the docstring of SynchronousTestCase.

Change History (2)

comment:1 Changed 7 years ago by DefaultCC Plugin

Cc: Jonathan Lange added

comment:2 Changed 7 years ago by Lucas Taylor

As a point of support, I found the module-level lookup to be surprising when attempting to use pyunit's skip decorators. e.g. simply importing a function named skip will cause all tests to skip:

from unittest import skip
# Why are all of my tests skipped?

I did finally discover that the docstrings for getSkip and getTodo do clarify the behavior:

"Checks on the instance first, then the class, then the module, then packages."

However, this also appears to be incorrect, in that I don't think that packages are actually searched.

See the definition of self._parents in [source:trunk/twisted/trial/_synctest.py#L828 SynchronousTestCase]

Note: See TracTickets for help on using tickets.