fixtures.reorder_items is non-deterministic because it reorders based
on iteration over an (unordered) set. Change the code to use an
OrderedDict instead so that we get deterministic behaviour, fixes#920.
Allow a class method decorated `@staticmethod` to be collected as a test
function (if it meets the usual criteria).
This feature will not work in Python 2.6 -- static methods will still be
ignored there.
- Avoid importing numpy unless necessary.
- Mention numpy arrays and dictionaries in the docs.
- Add numpy to the list of tox dependencies.
- Don't unnecessarily copy arrays or allocate empty space for them.
- Use code from compat.py rather than writing py2/3 versions of things
myself.
- Avoid reimplementing __repr__ for built-in types.
- Add an option to consider NaN == NaN, because sometimes people use NaN
to mean "missing data".
This fixes#1994. It turned out to require a lot of refactoring because
subclassing numpy.ndarray was necessary to coerce python into calling
the right `__eq__` operator.
this allows a clear addition of parameterization parameters that carry along marks
instead of nesting multiple mark objects and destroying the possibility of creating
function valued parameters,
it just folders everything together into one object carrfying parameters, and the marks.
Descriptors (e.g. properties) such as in the added test case are
triggered during collection, executing arbitrary code which can raise.
Previously, such exceptions were propagated and failed the collection.
Now these exceptions are caught and the corresponding attributes are
silently ignored.
A better solution would be to completely skip access to all custom
descriptors, such that the offending code doesn't even trigger. However
I think this requires manually going through the instance and all of its
MRO for each and every attribute checking if it might be a proper
fixture before accessing it. So I took the easy route here.
In other words, putting something like this in your test class is still
a bad idea...:
@property
def innocent(self):
os.system('rm -rf /')
Fixes#2234.