Bug fixes:
- When running Hypothesis tests in parallel (e.g. using pytest-xdist) there was
a race condition caused by code generation.
- Example databases are now cached per thread so as to not use sqlite
connections from multiple threads. This should make Hypothesis now entirely
thread safe.
- floats() with only min_value or max_value set would have had a very bad
distribution.
- Running on 3.5, Hypothesis would have emitted deprecation warnings because of
use of inspect.getargspec
Changelog:
- Allow 'dev', 'rc', or other non-integer version strings in `importorskip`.
Thanks to Eric Hunsberger for the PR.
- fix issue856: consider --color parameter in all outputs (for example
--fixtures). Thanks Barney Gale for the report and Bruno Oliveira for the PR.
- fix issue855: passing str objects as `plugins` argument to pytest.main
is now interpreted as a module name to be imported and registered as a
plugin, instead of silently having no effect.
Thanks xmo-odoo for the report and Bruno Oliveira for the PR.
- fix issue744: fix for ast.Call changes in Python 3.5+. Thanks
Guido van Rossum, Matthias Bussonnier, Stefan Zimmermann and
Thomas Kluyver.
- fix issue842: applying markers in classes no longer propagate this markers
to superclasses which also have markers.
Thanks xmo-odoo for the report and Bruno Oliveira for the PR.
- preserve warning functions after call to pytest.deprecated_call. Thanks
Pieter Mulder for PR.
- fix issue854: autouse yield_fixtures defined as class members of
unittest.TestCase subclasses now work as expected.
Thannks xmo-odoo for the report and Bruno Oliveira for the PR.
- fix issue833: --fixtures now shows all fixtures of collected test files, instead of just the
fixtures declared on the first one.
Thanks Florian Bruhin for reporting and Bruno Oliveira for the PR.
- fix issue863: skipped tests now report the correct reason when a skip/xfail
condition is met when using multiple markers.
Thanks Raphael Pierzina for reporting and Bruno Oliveira for the PR.
- optimized tmpdir fixture initialization, which should make test sessions
faster (specially when using pytest-xdist). The only visible effect
is that now pytest uses a subdirectory in the $TEMP directory for all
directories created by this fixture (defaults to $TEMP/pytest-$USER).
Thanks Bruno Oliveira for the PR.
- Reduced verbosity when exceptions are captured in virtual methods.
- `pytestqt.plugin` has been split in several files and tests have been
moved out of the `pytestqt` package. This should not affect users, but it
is worth mentioning nonetheless.
- `QApplication.processEvents()` is now called before and after other fixtures
and teardown hooks, to better try to avoid non-processed events from leaking
from one test to the next.
- Show Qt/PyQt/PySide versions in pytest header.
- Disconnect SignalBlocker functions after its loop exits to ensure second
emissions that call the internal functions on the now-garbage-collected
SignalBlocker instance.
Changelog:
- text() with a non-string alphabet would have used the repr() of the the
alphabet instead of its contexts. This is obviously silly. It now works with
any sequence of things convertible to unicode strings.
- @given will now work on methods whose definitions contains no explicit
positional arguments, only varargs. This may have some knock on effects
because it means that @given no longer changes the argspec of functions other
than by adding defaults.
- Introduction of new @composite feature for more natural definition of
strategies you'd previously have used flatmap for.
Upstream changelog:
* lists(elements, unique_by=some_function, min_size=n) would have raised a
ValidationError if n > Settings.default.average_list_length because it would
have wanted to use an average list length shorter than the minimum size of
the list, which is impossible. Now it instead defaults to twice the minimum
size in these circumstances.
* basic() strategy would have only ever produced at most ten distinct values
per run of the test (which is bad if you e.g. have it inside a list). This
was obviously silly. It will now produce a much better distribution of data,
both duplicated and non duplicated.
* star imports from hypothesis should now work correctly.
* example quality for examples using flatmap will be better, as the way it had
previously been implemented was causing problems where Hypothesis was
erroneously labelling some examples as being duplicates.
- The environment to run unittests is now called py34 as that's the common
thing used, and will also allow us to run the tests with Python 3.5.
- The default tests now also run coverage.py and do a coverage check (on
Linux).
- The smoke tests are now part of the default environment.
This is just a bugfix and performance release, but it changes some semi-public
APIs, hence the minor version bump.
- Significant performance improvements for strategies which are one_of() many
branches. In particular this included recursive() strategies. This should
take the case where you use one recursive() strategy as the base strategy of
another from unusably slow (tens of seconds per generated example) to
reasonably fast.
- Better handling of just() and sampled_from() for values which have an
incorrect __repr__ implementation that returns non-ASCII unicode on Python 2.
- Better performance for flatmap from changing the internal morpher API to be
significantly less general purpose.
- Introduce a new semi-public BuildContext/cleanup API. This allows strategies
to register cleanup activities that should run once the example is complete.
Note that this will interact somewhat weirdly with find.
- Better simplification behaviour for streaming strategies.
- Don't error on lambdas which use destructuring arguments in Python 2.
- Add some better reprs for a few strategies that were missing good ones.
- The Random instances provided by randoms() are now copyable.
- Slightly more debugging information about simplify when using a debug
verbosity level.
- Support using given for functions with varargs, but not passing arguments to
it as positional.
Changelog:
Filter out YES nodes when creating a temporary class for the with_metaclass
hack.
Having an YES node in a class bases will lead to a crash with a TypeError
when trying to obtain the ancestors of the given class, because .ancestors()
will try to iterate each inferred node from the bases, thus will try to
iterate over an YES node.
Upstream changelog:
Exceptions are now captured also during test tear down, as delayed events will
get processed then and might raise exceptions in virtual methods; this is
specially problematic in PyQt5.5, which changed the behavior to call abort by
default, which will crash the interpreter.
Changelog:
* Added --cov-fail-under, akin to the new fail_under option in coverage-4.0
(automatically activated if there's a [report] fail_under = ... in
.coveragerc).
* Changed --cov-report=term to automatically upgrade to
--cov-report=term-missing if there's [run] show_missing = True in
.coveragerc.
* Changed --cov so it can be used with no path argument (in wich case the
source settings from .coveragerc will be used instead).
* Fixed .pth installation to work in all cases (install, easy_install, wheels,
develop etc).
* Fixed .pth uninstallation to work for wheel installs.
* Support for coverage 4.0.
* Data file suffixing changed to use coverage's data_suffix=True option
(instead of the custom suffixing).
* Avoid warning about missing coverage data (just like
coverage.control.process_startup).
* Fixed a race condition when running with xdist (all the workers tried to
combine the files). It's possible that this issue is not present in
pytest-cov 1.8.X.
Changelog:
Codename: The great bundling.
This release contains two fairly major changes.
The first is the deprecation of the hypothesis-extra mechanism. From now on all
the packages that were previously bundled under it other than hypothesis-pytest
(which is a different beast and will remain separate). The functionality
remains unchanged and you can still import them from exactly the same location,
they just are no longer separate packages.
The second is that this introduces a new way of building strategies which lets
you build up strategies recursively from other strategies.
It also contains the minor change that calling .example() on a strategy object
will give you examples that are more representative of the actual data you'll
get. There used to be some logic in there to make the examples artificially
simple but this proved to be a bad idea.
Upstream changelog:
New Features
* Added support for more flexible error selections using --ignore, --select,
--convention, --add-ignore and --add-select (#96, #123).
Bug Fixes
* Property setter and deleter methods are now treated as private and do not
require docstrings separate from the main property method (#69, #107).
* Fixed an issue where pep257 did not accept docstrings that are both
unicode and raw in Python 2.x (#116, #119).
* Fixed an issue where Python 3.x files with Unicode encodings were
not read correctly (#118).