[py-dev] py.test and --session, re-run failures only
Ian Bicking
ianb at colorstudy.com
Sat Apr 2 02:48:51 CEST 2005
Martin Blais wrote:
> oh, while we're taking a shot at the future, another feature that i
> used to have was the ability to compare the test output to a fixed
> file, we called this "expect files", because the test was expected to
> generate specific output. might not be useful now but you could note
> that in the futures document as well, for some kinds of tests this can
> be a quick-n-dirty way to write a test. dump something on the output,
> inspect it to make sure it's allright, dump that into an expect file.
> could be easy to implement since you already capture the output text.
> note that these kinds of tests fail on outputs sensitive to numerical
> (im)precision.
That's called doctest ;) -- of course better integration of that is also
in the future at this point.
> and another one: for C++ code which can crash, a timeout option is
> absolutely *essential*.
This could potentially be implemented as a decorator, like:
@py.test.timeout(10)
def test_cpp_code():
...
def timeout(seconds):
def replacement_func(*args, **kw):
some stuff with alarm signals and whatnot...
return replacement_func
Of course, you can't apply a decorator globally with an option, but it's
probably only in specific areas where you'd need this anyway.
--
Ian Bicking / ianb at colorstudy.com / http://blog.ianbicking.org
More information about the Pytest-dev
mailing list