- 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__.
- 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).
Bug fixes:
- Settings(database=my_db) would not be correctly inherited when used as a
default setting, so that newly created settings would use the database_file
setting and create an SQLite example database.
- Settings.default.database = my_db would previously have raised an error and
now works.
- Timeout could sometimes be significantly exceeded if during simplification
there were a lot of examples tried that didn't trigger the bug.
- When loading a heavily simplified example using a basic() strategy from the
database this could cause Python to trigger a recursion error.
- Remove use of deprecated API in pytest plugin so as to not emit warning
Misc:
- hypothesis-pytest is now part of hypothesis core. This should have no
externally visible consequences, but you should update your dependencies to
remove hypothesis-pytest and depend on only Hypothesis.
- Better repr for hypothesis.extra.datetimes() strategies.
- Add .close() method to abstract base class for Backend (it was already
present in the main implemnetation).
Changelog:
Backward incompatibilities:
- Python versions supported are now:
- CPython 2.6, 2.7, 3.3, 3.4 and 3.5
- PyPy2 2.4, 2.6
- PyPy3 2.4
- The original command line switches (-x to run a program, etc) are no longer
supported.
- The COVERAGE_OPTIONS environment variable is no longer supported. It was a
hack for --timid before configuration files were available.
- The original module-level function interface to coverage.py is no longer
supported. You must now create a coverage.Coverage object, and use methods on
it.
- The Coverage.use_cache method is no longer supported.
- The private method Coverage._harvest_data is now called Coverage.get_data(),
and returns the CoverageData containing the collected data.
- Coverage.py is now licensed under the Apache 2.0 license. See NOTICE.txt for
details.
- Coverage.py kits no longer include tests and docs. If you were using them,
get in touch and let me know how.
Major new features:
- Plugins: third parties can write plugins to add file support for non-Python
files, such as web application templating engines, or languages that compile
down to Python. See Plugins for how to use plugins, and Plugin classes for
details of how to write them. A plugin for measuring Django template coverage
is available: django_coverage_plugin
- Gevent, eventlet, and greenlet are now supported. The [run] concurrency
setting, or the --concurrency command line switch, specifies the concurrency
library in use. Huge thanks to Peter Portante for initial implementation, and
to Joe Jevnik for the final insight that completed the work.
- The data storage has been re-written, using JSON instead of pickle. The
CoverageData class is a new supported API to the contents of the data file.
Data files from older versions of coverage.py can be converted to the new
format with python -m coverage.pickle2json.
- Wildly experimental: support for measuring processes started by the
multiprocessing module. To use, set --concurrency=multiprocessing, either on
the command line or in the .coveragerc file. Thanks, Eduardo Schettino.
Currently, this does not work on Windows.
New features:
- Options are now also read from a setup.cfg file, if any. Sections are
prefixed with “coverage:”, so the [run] options will be read from the
[coverage:run] section of setup.cfg.
- The HTML report now has filtering. Type text into the Filter box on the index
page, and only modules with that text in the name will be shown. Thanks,
Danny Allen.
- A new option: coverage report --skip-covered (or [report] skip_covered) will
reduce the number of files reported by skipping files with 100% coverage.
Thanks, Krystian Kichewko. This means that empty __init__.py files will be
skipped, since they are 100% covered.
- You can now specify the --fail-under option in the .coveragerc file as the
[report] fail_under option.
- The report -m command now shows missing branches when reporting on branch
coverage. Thanks, Steve Leonard.
- The coverage combine command now accepts any number of directories or files
as arguments, and will combine all the data from them. This means you don’t
have to copy the files to one directory before combining. Thanks, Christine
Lytwynec.
- A new configuration option for the XML report: [xml] package_depth controls
which directories are identified as packages in the report. Directories
deeper than this depth are not reported as packages. The default is that all
directories are reported as packages. Thanks, Lex Berezhny.
- A new configuration option, [run] note, lets you set a note that will be
stored in the runs section of the data file. You can use this to annotate the
data file with any information you like.
- The COVERAGE_DEBUG environment variable can be used to set the [run] debug
configuration option to control what internal operations are logged.
- A new version identifier is available, coverage.version_info, a plain tuple
of values similar to sys.version_info.
Improvements:
- Coverage.py now always adds the current directory to sys.path, so that
plugins can import files in the current directory.
- Coverage.py now accepts a directory name for coverage run and will run a
__main__.py found there, just like Python will. Thanks, Dmitry Trofimov.
- The --debug switch can now be used on any command.
- Reports now use file names with extensions. Previously, a report would
describe a/b/c.py as “a/b/c”. Now it is shown as “a/b/c.py”. This allows for
better support of non-Python files.
- Missing branches in the HTML report now have a bit more information in the
right-hand annotations. Hopefully this will make their meaning clearer.
- The XML report now contains a <source> element. Thanks Stan Hu.
- The XML report now includes a missing-branches attribute. Thanks, Steve Peak.
This is not a part of the Cobertura DTD, so the XML report no longer
references the DTD.
- The XML report now reports each directory as a package again. This was a bad
regression, I apologize.
- In parallel mode, coverage erase will now delete all of the data files.
- A new warning is possible, if a desired file isn’t measured because it was
imported before coverage.py was started.
- The coverage.process_startup() function now will start coverage measurement
only once, no matter how many times it is called. This fixes problems due to
unusual virtualenv configurations.
- Unrecognized configuration options will now print an error message and stop
coverage.py. This should help prevent configuration mistakes from passing
silently.
API changes:
- The class defined in the coverage module is now called Coverage instead of
coverage, though the old name still works, for backward compatibility.
- You can now programmatically adjust the configuration of coverage.py by
calling Coverage.set_option() after construction. Coverage.get_option() reads
the configuration values.
- If the config_file argument to the Coverage constructor is specified as
”.coveragerc”, it is treated as if it were True. This means setup.cfg is also
examined, and a missing file is not considered an error.
Bug fixes:
- The textual report and the HTML report used to report partial branches
differently for no good reason. Now the text report’s “missing branches”
column is a “partial branches” column so that both reports show the same
numbers. This closes issue 342.
- The fail-under value is now rounded the same as reported results, preventing
paradoxical results, fixing issue 284.
- Branch coverage couldn’t properly handle certain extremely long files. This
is now fixed, closing issue 359.
- Branch coverage didn’t understand yield statements properly. Mickie Betz
persisted in pursuing this despite Ned’s pessimism. Fixes issue 308 and issue
324.
- Files with incorrect encoding declaration comments are no longer ignored by
the reporting commands.
- Empty files are now reported as 100% covered in the XML report, not 0%
covered.
- The XML report will now create the output directory if need be. Thanks, Chris
Rose.
- HTML reports no longer raise UnicodeDecodeError if a Python file has
undecodable characters.
- The annotate command will now annotate all files, not just ones relative to
the current directory.
Changes:
- Don't mark shadowing variable as 'used'.
- Test that used variable in loop is considered used
- Don't report UnusedImport when binding global name
- Support Python 3.5 async/await statements for Pyflakes.
- Use os.linesep for Windows compatibility
- os.chmod() supports only read-only flag operations on Windows
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.