- Exception capturing now happens as early/late as possible in order to catch
all possible exceptions (including fixtures).
- Widgets registered by qtbot.addWidget are now closed before all other
fixtures are tear down.
- qtbot now has a new wait method which does a blocking wait while the event
loop continues to run, similar to QTest::qWait.
- raise RuntimeError instead of ImportError when failing to import any Qt
binding: raising the latter causes pluggy in pytest-2.8 to generate a subtle
warning instead of a full blown error.
New features:
* Add 'note' function which lets you include additional information in the
final test run's output.
* Add 'choices' strategy which gives you a choice function that emulates
random.choice.
* Add 'uuid' strategy that generates UUIDs'
* Add 'shared' strategy that lets you create a strategy that just generates a
single shared value for each test run
Bugs:
* Using strategies of the form streaming(x.flatmap(f)) with find or in stateful
testing would have caused InvalidArgument errors when the resulting values
were used (because code that expected to only be called within a test context
would be invoked).
* Do not complain about missing .gitattributes file.
* Normalize unicode representation and case of filenames.
* Drop Python 2.6 support.
* Support installation via zc.buildout better.
This is quite a small release, but deprecates some public API functions and
removes some internal API functionality so gets a minor version bump.
- All calls to the 'strategy' function are now deprecated, even ones which pass
just a SearchStrategy instance (which is still a no-op).
- Never documented hypothesis.extra entry_points mechanism has now been removed
(it was previously how hypothesis.extra packages were loaded and has been
deprecated and unused for some time)
- Some corner cases that could previously have produced an OverflowError when
simplifying failing cases using hypothesis.extra.datetimes (or dates or
times) have now been fixed.
- Hypothesis load time for first import has been significantly reduced - it
used to be around 250ms (on my SSD laptop) and now is around 100-150ms. This
almost never matters but was slightly annoying when using it in the console.
- hypothesis.strategies.randoms was previously missing from __all__.
- Significantly improved performance of creating strategies using the functions
from the hypothesis.strategies module by deferring the calculation of their
repr until it was needed. This is unlikely to have been an performance issue
for you unless you were using flatmap, composite or stateful testing, but for
some cases it could be quite a significant impact.
- A number of cases where the repr of strategies build from lambdas is improved
- Add dates() and times() strategies to hypothesis.extra.datetimes
- Add new 'profiles' mechanism to the settings system
- Deprecates mutability of Settings, both the Settings.default top level
property and individual settings.
- A Settings object may now be directly initialized from a parent Settings.
- @given should now give a better error message if you attempt to use it with a
function that uses destructuring arguments (it still won't work, but it will
error more clearly),
- A number of spelling corrections in error messages
- py.test should no longer display the intermediate modules Hypothesis
generates when running in verbose mode
- Hypothesis should now correctly handle printing objects with non-ascii reprs
on python 3 when running in a locale that cannot handle ascii printing to
stdout.
- Add a unique=True argument to lists(). This is equivalent to unique_by=lambda
x: x, but offers a more convenient syntax.
- pytest.mark.qt_log_ignore now supports an extend parameter that will extend
the list of regexes used to ignore Qt messages (defaults to False).
- Fixed internal error when interacting with other plugins that raise an error,
hiding the original exception.
- When combining data files, unreadable files will now generate a warning
instead of failing the command. This is more in line with the older
coverage.py v3.7.1 behavior, which silently ignored unreadable files.
- The --skip-covered option would skip reporting on 100% covered files, but
also skipped them when calculating total coverage. This was wrong, it should
only remove lines from the report, not change the final answer. This is now
fixed.
- In 4.0, the data file recorded a summary of the system on which it was run.
Combined data files would keep all of those summaries. This could lead to
enormous data files consisting of mostly repetitive useless information. That
summary is now gone. If you want summary information,
get in touch, and we'll figure out a better way to do it.
- Test suites that mocked os.path.exists would experience strange failures, due
to coverage.py using their mock inadvertently. This is now fixed.
- Importing a ``__init__`` module explicitly would lead to an error:
``AttributeError: 'module' object has no attribute '__path__'``. This is now
fixed.
- Code that uses ``sys.settrace(sys.gettrace())`` used to incur a more than 2x
speed penalty. Now there's no penalty at all.
- Pyexpat C code will no longer be recorded as a source file.
- The source kit now contains all of the files needed to have a complete source
tree.
* configuration: have a stable order for sections
* testlib: clean out deprecated TestCase methods, move pytest specifics to pytest.py
* fix a few python3 bugs in umessage, configuration and optik_ext modules
* testlib: report failures and skips in generative tests properly
* optik_ext: return bytes as ints and not floats
- Colour progressbar correctly for low number of tests
- Fix error case when deactivating pytest-sugar using --lf together with
--nosugar
- --nosugar deprecated, use -p no:sugar
Upstream changelog:
New Features
- Added the D104 error code - "Missing docstring in public package". This new
error is turned on by default. Missing docstring in __init__.py files which
previously resulted in D100 errors ("Missing docstring in public module")
will now result in D104.
- Added the D105 error code - "Missing docstring in magic method'. This new
error is turned on by default. Missing docstrings in magic method which
previously resulted in D102 error ("Missing docstring in public method") will
now result in D105. Note that exceptions to this rule are variadic magic
methods - specifically __init__, __call__ and __new__, which will be
considered non-magic and missing docstrings in them will result in D102.
- Support the option to exclude all error codes. Running pep257 with --select=
(or select= in the configuration file) will exclude all errors which could
then be added one by one using add-select. Useful for projects new to pep257.
- Added check D211: No blank lines allowed before class docstring. This change
is a result of a change to the official PEP257 convention. Therefore, D211
will now be checked by default instead of D203, which required a single blank
line before a class docstring.
- Configuration files are now handled correctly. The closer a configuration
file is to a checked file the more it matters. Configuration files no longer
support explain, source, debug, verbose or count.
Bug Fixes
- On Python 2.x, D302 ("Use u""" for Unicode docstrings") is not reported if
unicode_literals is imported from __future__.
- Fixed a bug where there was no executable for pep257 on Windows.
Upstream changelog:
- Improve the performance of `six.int2byte` on Python 3.
- Don't add the `winreg` module to `six.moves` on non-Windows platforms.
- Add `six.moves.getcwd` and `six.moves.getcwdu`.
- Add `create_unbound_method` to create unbound methods.
Upstream changelog:
* Added support for changing working directory in tests. Previously changing
working directory would disable coverage measurements in suprocesses.
* Fixed broken handling for ``--cov-report=annotate``.
Upstream changelog:
* Fixed a bug that deranged the tree when part of it was
removed. Thanks to Eric Weiser for the patch and John Wiseman for a
test.
* Fixed a parse bug with the html5lib tree-builder. Thanks to Roel
Kramer for the patch.
* Improved the implementation of CSS selector grouping. Thanks to
Orangain for the patch.
* Fixed the test_detect_utf8 test so that it works when chardet is
installed.
* Corrected the output of Declaration objects.
- Hide modifications Hypothesis needs to make to sys.path by undoing them after
we've imported the relevant modules. This is a workaround for issues
cryptography experienced on windows.
- Slightly improved performance of drawing from sampled_from on large lists of
alternatives.
- Significantly improved performance of drawing from one_of or strategies using
| (note this includes a lot of strategies internally - floats() and
integers() both fall into this category). There turned out to be a massive
performance regression introduced in 1.10.0 affecting these which probably
would have made tests using Hypothesis significantly slower than they should
have been.
- Better argument validation for datetimes() strategy - previously setting
max_year < datetime.MIN_YEAR or min_year > datetime.MAX_YEAR would not have
raised an InvalidArgument error and instead would have behaved confusingly.
- Compatibility with being run on pytest < 2.7 (achieved by disabling the
plugin).