- use predictable object resolution for monkeypatch
- allow for double nodeids in junitxml,
this was a regression failing plugins combinations like pytest-pep8 +
pytest-flakes
- Workaround for exception that occurs in pyreadline when using ``--pdb`` with
standard I/O capture enabled.
- Better error message in case the target of a ``monkeypatch`` call raises an
``ImportError``.
- monkeypatch calls (setattr, setenv, etc.) are now O(1).
- captured stdout and stderr are now properly displayed before entering pdb
when ``--pdb`` is used instead of being thrown away.
- pytest warnings emitted during ``pytest_terminal_summary`` are now properly
displayed.
- fixed internal UnicodeDecodeError when doctests contain unicode.
- Add captured stdout to jUnit XML report on setup error.
Unfortunately running coverage means our tests need more than a minute longer
to run.
We still run it in the following scenarios:
- Full 'tox' run
- On Travis CI on Linux
- On the buildbot on Archlinux
But not anymore in the following scenarios:
- When running 'tox -e py35' (or py34)
- On Travis CI on OS X
- On AppVeyor
- On the buildbot except on Archlinux
- allow for double nodeids in junitxml,
this was a regression failing plugins combinations like pytest-pep8 +
pytest-flakes
- Workaround for exception that occurs in pyreadline when using ``--pdb`` with
standard I/O capture enabled.
- Better error message in case the target of a ``monkeypatch`` call raises an
``ImportError``.
- monkeypatch calls (setattr, setenv, etc.) are now O(1).
- captured stdout and stderr are now properly displayed before entering pdb
when ``--pdb`` is used instead of being thrown away.
- pytest warnings emitted during ``pytest_terminal_summary`` are now properly
displayed.
- fixed internal UnicodeDecodeError when doctests contain unicode.
- Add captured stdout to jUnit XML report on setup error.
We're now ready for #1226, but this only updates pep8 for now.
Changes:
* Reverted the fix, "options passed on command line are only ones accepted"
feature. This has many unintended consequences in pep8 and flake8 and needs to
be reworked when I have more time.
* Added support for Python 3.5.
* Added support for multi-line config_file option parsing.
* Improved parameter parsing.
Bugs:
* Fixed BytesWarning on Python 3.
pylint:
* Merge StringMethodChecker with StringFormatChecker. This fixes a
bug where disabling all the messages and enabling only a handful of
messages from the StringFormatChecker would have resulted in no
messages at all.
* Don't apply unneeded-not over sets.
astroid:
* unpack_infer raises InferenceError if it can't operate
with the given sequences of nodes.
* Support accessing properties with super().
* Enforce strong updates per frames.
When looking up a name in a scope, Scope.lookup will return
only the values which will be reachable after execution, as seen
in the following code:
a = 1
a = 2
In this case it doesn't make sense to return two values, but
only the last one.
* Handle the import fallback idiom with regard to wrong-import-order.
* Decouple the displaying of reports from the displaying of messages
Some reporters are aggregating the messages instead of displaying
them when they are available. The actual displaying was conflatted
in the generate_reports. Unfortunately this behaviour was flaky
and in the case of the JSON reporter, the messages weren't shown
at all if a file had syntax errors or if it was missing.
In order to fix this, the aggregated messages can now be
displayed with Reporter.display_message, while the reports are
displayed with display_reports.
* Ignore function calls with variadic arguments without a context.
Inferring variadic positional arguments and keyword arguments
will result into empty Tuples and Dicts, which can lead in
some cases to false positives with regard to no-value-for-parameter.
In order to avoid this, until we'll have support for call context
propagation, we're ignoring such cases if detected.
* Treat AsyncFunctionDef just like FunctionDef nodes,
by implementing visit_asyncfunctiondef in terms of
visit_functiondef.
* Take in account kwonlyargs when verifying that arguments
are defined with the check_docs extension.
* Suppress reporting 'unneeded-not' inside `__ne__` methods
2.0.0 - 2016-01-10
------------------
Codename: A new beginning
This release cleans up all of the legacy that accrued in the course of
Hypothesis 1.0. These are mostly things that were emitting deprecation warnings
in 1.19.0, but there were a few additional changes.
In particular:
- non-strategy values will no longer be converted to strategies when used in
given or find.
- FailedHealthCheck is now an error and not a warning.
- Handling of non-ascii reprs in user types have been simplified by using raw
strings in more places in Python 2.
- given no longer allows mixing positional and keyword arguments.
- given no longer works with functions with defaults.
- given no longer turns provided arguments into defaults - they will not appear
in the argspec at all.
- the basic() strategy no longer exists.
- the n_ary_tree strategy no longer exists.
- the average_list_length setting no longer exists. Note: If you're using using
recursive() this will cause you a significant slow down. You should pass
explicit average_size parameters to collections in recursive calls.
- @rule can no longer be applied to the same method twice.
- Python 2.6 and 3.3 are no longer officially supported, although in practice
they still work fine.
This also includes two non-deprecation changes:
- given's keyword arguments no longer have to be the rightmost arguments and
can appear anywhere in the method signature.
- The max_shrinks setting would sometimes not have been respected.
1.19.0 - 2016-01-09
-------------------
Codename: IT COMES
This release heralds the beginning of a new and terrible age of Hypothesis 2.0.
It's primary purpose is some final deprecations prior to said release. The goal
is that if your code emits no warnings under this release then it will probably
run unchanged under Hypothesis 2.0 (there are some caveats to this: 2.0 will
drop support for some Python versions, and if you're using internal APIs then
as usual that may break without warning).
It does have two new features:
- New @seed() decorator which allows you to manually seed a test. This may be
harmlessly combined with and overrides the derandomize setting.
- settings objects may now be used as a decorator to fix those settings to a
particular @given test.
API changes (old usage still works but is deprecated):
- Settings has been renamed to settings (lower casing) in order to make the
decorator usage more natural.
- Functions for the storage directory that were in hypothesis.settings are now
in a new hypothesis.configuration module.
Additional deprecations:
- the average_list_length setting has been deprecated in favour of being
explicit.
- the basic() strategy has been deprecated as it is impossible to support it
under a Conjecture based model, which will hopefully be implemented at some
point in the 2.x series.
- the n_ary_tree strategy (which was never actually part of the public API) has
been deprecated.
- Passing settings or random as keyword arguments to given is deprecated (use
the new functionality instead)
Bug fixes:
- No longer emit PendingDeprecationWarning for __iter__ and StopIteration in
streaming() values.
- When running in health check mode with non strict, don't print quite so many
errors for an exception in reify.
- When an assumption made in a test or a filter is flaky, tests will now raise
Flaky instead of UnsatisfiedAssumption.
While pytest-sugar was nice to look at, it produced a lot of issues:
- Unusable on CI
- Unusable on OS X and Windows
- Garbage when terminal was resized during tests
- Missing space after test name since some while
This replaces it by pytest-instafail, which replaces the most important feature
of sugar, and on top of that, also works on CI.
- New qt_wait_signal_raising ini option can be used to override the default
value of the raising parameter of the qtbot.waitSignal and qtbot.waitSignals
functions when omitted:
Calls which explicitly pass the raising parameter are not affected.
- qtbot now has a new assertNotEmitted context manager which can be used to
ensure the given signal is not emitted.
Bugfixes
- Resolve regression introduced in 2.9.0 that made it impossible to send binary
strings as bodies in Python 3.
- Fixed errors when calculating cookie expiration dates in certain locales.
Miscellaneous
- Updated bundled urllib3 to 1.13.1.
- Hypothesis will no longer write generated code to the file system. This will
improve performance on some systems (e.g. if you're using PythonAnywhere
which is running your code from NFS) and prevent some annoying interactions
with auto-restarting systems.
- Hypothesis will cache the creation of some strategies. This can significantly
improve performance for code that uses flatmap or composite and thus has to
instantiate strategies a lot.
* pkg_resources brain tips are a bit more specific, by specifiying proper
returns.
* Standard library modules are properly detected by is_standard_module.
Features:
- Tests and find are now explicitly seeded off the global random module. This
means that if you nest one inside the other you will now get a health check
error. It also means that you can control global randomization by seeding
random.
- There is a new random_module() strategy which seeds the global random module
for you and handles things so that you don't get a health check warning if
you use it inside your tests.
- floats() now accepts two new arguments: allow_nan and allow_infinity. These
default to the old behaviour, but when set to False will do what the names
suggest.
Bug fixes:
- Fix a bug where tests that used text() on Python 3.4+ would not actually be
deterministic even when explicitly seeded or using the derandomize mode,
because generation depended on dictionary iteration order which was affected
by hash randomization.
- Fix a bug where with complicated strategies the timing of the initial health
check could affect the seeding of the subsequent test, which would also
render supposedly deterministic tests non-deterministic in some scenarios.
- In some circumstances flatmap() could get confused by two structurally
similar things it could generate and would produce a flaky test where the
first time it produced an error but the second time it produced the other
value, which was not an error. The same bug was presumably also possible in
composite().
- flatmap() and composite() initial generation should now be moderately faster.
This will be particularly noticeable when you have many values drawn from the
same strategy in a single run, e.g. constructs like lists(s.flatmap(f)).
Shrinking performance may have suffered, but this didn't actually produce an
interestingly worse result in any of the standard scenarios tested.
- Fixed an issue with copy operations not working against
proxies.
- Changed the logging operations of the development server to
correctly log where the server is running in all situations
again.
- Fixed another regression with SSL wrapping similar to the
fix in 0.11.2 but for a different code path.
-----
5.0.0
-----
* Removed deprecated support for ``ssl_certificate`` and
``ssl_private_key`` attributes and implicit construction
of SSL adapter on Python 2 WSGI servers.
* Default SSL Adapter on Python 2 is the builtin SSL adapter,
matching Python 3 behavior.
-----
4.0.0
-----
* Drop support for Python 2.5 and earlier.
* No longer build Windows installers by default.
A small bug fix release, which fixes the fact that the 'note' function could
not be used on tests which used the @example decorator to provide explicit
examples.
- SignalBlocker now has a args attribute with the arguments of the signal that
triggered it, or None on a time out.
- MultiSignalBlocker is now properly disconnects from signals upon exit.
Minor Improvements (Backwards compatible)
- The verify keyword argument now supports being passed a path to a directory
of CA certificates, not just a single-file bundle.
- Warnings are now emitted when sending files opened in text mode.
- Added the 511 Network Authentication Required status code to the status code
registry.
Bugfixes
- For file-like objects that are not seeked to the very beginning, we now send
the content length for the number of bytes we will actually read, rather than
the total size of the file, allowing partial file uploads.
- When uploading file-like objects, if they are empty or have no obvious
content length we set Transfer-Encoding: chunked rather than
Content-Length: 0.
- We correctly receive the response in buffered mode when uploading chunked
bodies.
- We now handle being passed a query string as a bytestring on Python 3, by
decoding it as UTF-8.
- Sessions are now closed in all cases (exceptional and not) when using the
functional API rather than leaking and waiting for the garbage collector to
clean them up.
- Correctly handle digest auth headers with a malformed qop directive that
contains no token, by treating it the same as if no qop directive was
provided at all.
- Minor performance improvements when removing specific cookies by name.
This is actually the same release as 1.16.1, but 1.16.1 has been pulled because
it contains the following additional change that was not intended to be in a
patch release (it's perfectly stable, but is a larger change that should have
required a minor version bump):
Hypothesis will now perform a series of "health checks" as part of running your
tests. These detect and warn about some common error conditions that people
often run into which wouldn't necessarily have caued the test to fail but would
cause e.g. degraded performance or confusing results.
A small bugfix release that allows bdists for Hypothesis to be built under 2.7
- the compat3.py file which had Python 3 syntax wasn't intended to be loaded
under Python 2, but when building a bdist it was. In particular this would
break running setup.py test.
- fixed issue where class attributes injected during collection could break pytest.
- precompute junitxml chunks instead of storing the whole tree in objects
- fix ``pytest.deprecated_call()`` receiving multiple arguments
(Regression introduced in 2.8.4).
- Support git submodules
- Revert the zc.buildout support hack from 0.26 because it causes breakage
- Improve non-ASCII filename handling with Bazaar on Windows.
There are no public API changes in this release but it includes a behaviour
change that I wasn't comfortable putting in a patch release.
- Functions from hypothesis.strategies will no longer raise InvalidArgument on
bad arguments. Instead the same errors will be raised when a test using such
a strategy is run. This may improve startup time in some cases, but the main
reason for it is so that errors in strategies won't cause errors in loading,
and it can interact correctly with things like pytest.mark.skipif.
- Errors caused by accidentally invoking the legacy API are now much less
confusing, although still throw NotImplementedError.
- hypothesis.extra.django is 1.9 compatible.
- When tests are run with max_shrinks=0 this will now still rerun the test on
failure and will no longer print "Trying example:" before each run.
Additionally note() will now work correctly when used with max_shrinks=0.
Documented a quirk signaled by David Goldstein when writing decorators for
functions with keyword arguments. Avoided copying the globals, as signaled by
Benjamin Peterson (2015/12/09)
- ``deprecated_call()`` now works when the deprecated function has been already
called by another test in the same module.
- ``--pastebin`` option now works on Python 3.
- ``--pastebin`` now works correctly when captured output contains non-ascii
characters.
- Fix another error when collecting with a nasty __getattr__().
- fix the summary printed when no tests did run.
- a number of documentation modernizations wrt good practices.
* Don't emit unsubscriptable-object if the node is found
inside an abstract class.
* Add wrong-import-position to check_messages's decorator arguments
for ImportChecker.leave_module
This fixes an esoteric bug which occurs when ungrouped-imports and
wrong-import-order are disabled and pylint is executed on multiple files.
What happens is that without wrong-import-position in check_messages,
leave_module will never be called, which means that the first non-import node
from other files might leak into the current file,
leading to wrong-import-position being emitted by pylint.
* Fix a crash which occurred when old visit methods are encountered
in plugin modules.
* Don't emit import-self and cyclic-import for relative imports
of modules with the same name as the package itself.
If we do it in tox.ini, there are two drawbacks:
- We have more stuff in PYTHONPATH even if we don't when actually using
qutebrowser.
- The separator is platform specific, so we can't easily do this in a portable
way in tox.ini.
- Fixed a mysterious problem that manifested in different ways: sometimes
hanging the process, sometimes making database connections fail.
- The XML report now has correct <source> elements when using a --source=
option somewhere besides the current directory.
- Fixed an unusual edge case of detecting source encodings
- Help messages that mention the command to use now properly use the actual
command name, which might be different than “coverage”.
A release with two new features.
- A 'characters' strategy for more flexible generation of text with particular
character ranges and types.
- Add support for preconditions to the rule based stateful testing.
- add __name__ attribute to testcases in TestCaseFunction to support the
@unittest.skip decorator on functions and methods.
- collecting tests if test module level obj has __getattr__().
- don't collect tests if their failure cannot be reported correctly e.g. they
are a callable instance of a class.
- fixed internal error when filtering tracebacks where one entry belongs to a
file which is no longer available.
- enhancement made to highlight in red the name of the failing tests so
they stand out in the output.
- minor fixes for interaction with OS X El Capitan system integrity
protection
--faulthandler-timeout option is now properly supported in Python 3+; also a
warning is issued instead of an error on platforms without a
faulthandler.dump_traceback_later function.
- Fix inheritable sockets on Windows on Python 3.
- Fixed an issue with the forking server not starting any longer.
- Fixed SSL wrapping on platforms that supported opening sockets
by file descriptor.
- No longer log from the watchdog reloader.
- Unicode errors in hosts are now better catched or converted into
bad request errors.
Closes#1077.
There were two issues:
- Paths for coverage.py suddenly were absolute instead of relative, so we strip
the common base part if that happens.
/home/florian/proj/qutebrowser/git/qutebrowser/browser/cookies.py has 100%
coverage but is not in perfect_files!
/home/florian/proj/qutebrowser/git/qutebrowser/browser/http.py has 100%
coverage but is not in perfect_files!
[...]
- There was an io.UnsupportedOperationError in test_check_coverage.py because
of pytest-faulthandler, so we just don't load that in the subprocess.
Version 0.11
------------
Released on November 8th 2015, codename Gleisbaumaschine.
- Added ``reloader_paths`` option to ``run_simple`` and other functions in
``werkzeug.serving``. This allows the user to completely override the Python
module watching of Werkzeug with custom paths.
- Many custom cached properties of Werkzeug's classes are now subclasses of
Python's ``property`` type.
- ``bind_to_environ`` now doesn't differentiate between implicit and explicit
default port numbers in ``HTTP_HOST``.
- ``BuildErrors`` are now more informative. They come with a complete sentence
as error message, and also provide suggestions.
- Fix a bug in the user agent parser where Safari's build number instead of
version would be extracted.
- Fixed issue where RedisCache set_many was broken for twemproxy, which doesn't
support the default MULTI command.
- ``mimetype`` parameters on request and response classes are now always
converted to lowercase.
- Changed cache so that cache never expires if timeout is 0. This also fixes
an issue with redis setex
- Werkzeug now assumes ``UTF-8`` as filesystem encoding on Unix if Python
detected it as ASCII.
- New optional `has` method on caches.
- Fixed various bugs in `parse_options_header`.
- If the reloader is enabled the server will now open the socket in the parent
process if this is possible. This means that when the reloader kicks in
the connection from client will wait instead of tearing down. This does
not work on all Python versions.
- Implemented PIN based authentication for the debugger. This can optionally
be disabled but is discouraged. This change was necessary as it has been
discovered that too many people run the debugger in production.
- Devserver no longer requires SSL module to be installed.
Version 0.10.5
--------------
(bugfix release, release date yet to be decided)
- Reloader: Correctly detect file changes made by moving temporary files over
the original, which is e.g. the case with PyCharm.
- Fix bool behavior of ``werkzeug.datastructures.ETags`` under Python 3
- More work on supporting unusually encoded source.
- Files or directories with non-ASCII characters are now handled properly.
- Setting a trace function with sys.settrace was broken by a change in 4.0.1.
- Officially support PyPy 4.0, which required no changes, just updates to the
docs.
Fix utter breakage on Windows, introduced in 0.26. (The bug -- clearing the
environment unnecessarily -- could probably also cause locale-related problems
on other OSes.)
- 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__.