Version 4.1 --- 2016-05-21
- The internal attribute Reporter.file_reporters was removed in 4.1b3.
It should have come has no surprise that there were third-party tools
out there using that attribute. It has been restored, but with a
deprecation warning.
Version 4.1b3 --- 2016-05-10
- When running your program, execution can jump from an except X: line
to some other line when an exception other than X happens. This jump
is no longer considered a branch when measuring branch coverage.
- When measuring branch coverage, yield statements that were never
resumed were incorrectly marked as missing. This is now fixed.
- During branch coverage of single-line callables like lambdas and
generator expressions, coverage.py can now distinguish between them
never being called, or being called but not completed.
- The HTML report now has a map of the file along the rightmost edge of
the page, giving an overview of where the missed lines are. Thanks,
Dmitry Shishov.
- The HTML report now uses different monospaced fonts, favoring Consolas
over Courier. Along the way not properly handling one-space indents
was fixed. The index page also has slightly different styling, to try
to make the clickable detail pages more apparent.
- Missing branches reported with coverage report -m will now say ->exit
for missed branches to the exit of a function, rather than a negative
number.
- coverage --help and coverage --version now mention which tracer is
installed, to help diagnose problems. The docs mention which features
need the C extension.
- Officially support PyPy 5.1, which required no changes, just updates
to the docs.
- The Coverage.report function had two parameters with non-None
defaults, which have been changed. show_missing used to default to
True, but now defaults to None. If you had been calling
Coverage.report without specifying show_missing, you'll need to
explicitly set it to True to keep the same behavior. skip_covered used
to default to False. It is now None, which doesn't change the
behavior.
- It's never been possible to pass a namespace module to one of the
analysis functions, but now at least we raise a more specific error
message, rather than getting confused.
- The coverage.process_startup function now returns the Coverage
instance it creates.
- Make a small tweak to how we compare threads, to avoid buggy custom
comparison code in thread classes.
Version 4.1b2 --- 2016-01-23
- Problems with the new branch measurement in 4.1 beta 1 were fixed:
- Class docstrings were considered executable. Now they no longer are.
- yield from and await were considered returns from functions, since
they could tranfer control to the caller. This produced unhelpful
"missing branch" reports in a number of circumstances. Now they no
longer are considered returns.
- In unusual situations, a missing branch to a negative number was
reported.
- The XML report now produces correct package names for modules found in
directories specified with source=.
- coverage report won't produce trailing whitespace.
Version 4.1b1 --- 2016-01-10
- Branch analysis has been rewritten: it used to be based on bytecode,
but now uses AST analysis. This has changed a number of things:
- More code paths are now considered runnable, especially in
try/except structures. This may mean that coverage.py will identify
more code paths as uncovered. This could either raise or lower your
overall coverage number.
- Python 3.5's async and await keywords are properly supported
- Some long-standing branch coverage bugs were fixed:
- functions with only a docstring for a body would incorrectly
report a missing branch on the def line.
- code in an except block could be incorrectly marked as a missing
branch.
- context managers (with statements) in a loop or try block could
confuse the branch measurement, reporting incorrect partial
branches.
- In Python 3.5, an actual partial branch could be marked as
complete.
- Pragmas to disable coverage measurement can now be used on decorator
lines, and they will apply to the entire function or class being
decorated.
- Multiprocessing support is now available on Windows.
- Files with two encoding declarations are properly supported.
- Non-ascii characters in regexes in the configuration file worked in
3.7, but stopped working in 4.0. Now they work again.
- Form-feed characters would prevent accurate determination of the
beginning of statements in the rest of the file. This is now fixed.
- Split out the '==' behavior in ParserElement, now implemented
as the ParserElement.matches() method. Using '==' for string test
purposes will be removed in a future release.
- Expanded capabilities of runTests(). Will now accept embedded
comments (default is Python style, leading '#' character, but
customizable). Comments will be emitted along with the tests and
test output. Useful during test development, to create a test string
consisting only of test case description comments separated by
blank lines, and then fill in the test cases. Will also highlight
ParseFatalExceptions with "(FATAL)".
- Added a 'pyparsing_common' class containing common/helpful little
expressions such as integer, float, identifier, etc. I used this
class as a sort of embedded namespace, to contain these helpers
without further adding to pyparsing's namespace bloat.
- Minor enhancement to traceParseAction decorator, to retain the
parse action's name for the trace output.
- Added optional 'fatal' keyword arg to addCondition, to indicate that
a condition failure should halt parsing immediately.
- Even the “main” script is now byte-compiled
- The manual is on readthedocs.io now
- On installation try to compile the bootloader if there is none for the
current plattform
- (Unix) Use objcopy to create a valid ELF file
- (Linux): Compile with _FORTIFY_SOURCE
- New, updated and fixed hooks: CherryPy, Cryptography, enchant,
gi.repository.GdkPixbuf, gst, Lib2to3, PyQt4, PyQt5, PySide, SciPy,
sphinx, sqlalchemy, traitlets, wx.lib.pubsub
- For windowed mode add isatty() for our dummy NullWriter
- Suppress “Failed to execute script” in case of SystemExit
- Do not apply Upx compressor for bootloader files
- Fix absolute path for lib used via ctypes
- (OSX) Fix binary cache on NFS
- (Windows) Fix message in grab_version
- (Windows) Fix wrong icon paramter in Windows example
- (Windows) Fix win32 unicode handling
- (Windows) Fix unnecessary rebuilds caused by rebuilding winmanifest
- (Cygwin) Fix finding the Python library for Cygwin 64-bit
- (OSX) Fix compilation issue
- (Windows) No longer bundle pefile, use package from for windows
- (Windows) Provide a more robust means of executing a Python script
- AIX fixes.
- Update waf to version 1.8.20
- Fix excludedimports, more predictable order how hooks are applied
- Internal impovements and code clean-up
- Clean-ups fixes and improvements for the test suite
- _trim_arity fix in 2.1.2 was very version-dependent on Py 3.5.0.
Now works for Python 2.x, 3.3, 3.4, 3.5.0, and 3.5.1 (and hopefully
beyond).
This fixes pyparsing/flake8-putyt/flake8 being broken with python 3.4:
>>> import pyparsing
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File ".../pyparsing.py", line 3478, in <module>
_escapedPunc = Word( _bslash, r"\[]-*.$+^?()~ ", exact=2 ).setParseAction(lambda s,l,t:t[0][1])
File ".../pyparsing.py", line 948, in setParseAction
self.parseAction = list(map(_trim_arity, list(fns)))
File ".../pyparsing.py", line 808, in _trim_arity
this_line = extract_stack()[-1]
File ".../pyparsing.py", line 793, in extract_stack
return [(frame_summary.filename, frame_summary.lineno)]
AttributeError: 'tuple' object has no attribute 'filename'
See https://sourceforge.net/p/pyparsing/bugs/95/
It seems pyparsing 2.1.2 is broken with Python 3.4:
>>> import pyparsing
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File ".../pyparsing.py", line 3478, in <module>
_escapedPunc = Word( _bslash, r"\[]-*.$+^?()~ ", exact=2 ).setParseAction(lambda s,l,t:t[0][1])
File ".../pyparsing.py", line 948, in setParseAction
self.parseAction = list(map(_trim_arity, list(fns)))
File ".../pyparsing.py", line 808, in _trim_arity
this_line = extract_stack()[-1]
File ".../pyparsing.py", line 793, in extract_stack
return [(frame_summary.filename, frame_summary.lineno)]
AttributeError: 'tuple' object has no attribute 'filename'
That breaks flake8-putty and thus flake8.
See https://sourceforge.net/p/pyparsing/bugs/95/
On Travis CI, the flake8 env suddenly started to fail (pip upgrade?):
Invalid requirement: 'pep257==0.7.0 # still needed by flake8-docstrings but ignored'
Traceback (most recent call last):
File "/home/travis/build/The-Compiler/qutebrowser/.tox/flake8/lib/python3.4/site-packages/pip/_vendor/packaging/requirements.py", line 92, in __init__
req = REQUIREMENT.parseString(requirement_string)
File "/home/travis/build/The-Compiler/qutebrowser/.tox/flake8/lib/python3.4/site-packages/pip/_vendor/pyparsing.py", line 1172, in parseString
raise exc
File "/home/travis/build/The-Compiler/qutebrowser/.tox/flake8/lib/python3.4/site-packages/pip/_vendor/pyparsing.py", line 1162, in parseString
loc, tokens = self._parse( instring, 0 )
File "/home/travis/build/The-Compiler/qutebrowser/.tox/flake8/lib/python3.4/site-packages/pip/_vendor/pyparsing.py", line 1028, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/home/travis/build/The-Compiler/qutebrowser/.tox/flake8/lib/python3.4/site-packages/pip/_vendor/pyparsing.py", line 2462, in parseImpl
loc, exprtokens = e._parse( instring, loc, doActions )
File "/home/travis/build/The-Compiler/qutebrowser/.tox/flake8/lib/python3.4/site-packages/pip/_vendor/pyparsing.py", line 1032, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/home/travis/build/The-Compiler/qutebrowser/.tox/flake8/lib/python3.4/site-packages/pip/_vendor/pyparsing.py", line 2265, in parseImpl
raise ParseException(instring, loc, self.errmsg, self)
pip._vendor.pyparsing.ParseException: Expected stringEnd (at char 15), (line:1, col:16)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/travis/build/The-Compiler/qutebrowser/.tox/flake8/lib/python3.4/site-packages/pip/req/req_install.py", line 78, in __init__
req = Requirement(req)
File "/home/travis/build/The-Compiler/qutebrowser/.tox/flake8/lib/python3.4/site-packages/pip/_vendor/packaging/requirements.py", line 96, in __init__
requirement_string[e.loc:e.loc + 8]))
pip._vendor.packaging.requirements.InvalidRequirement: Invalid requirement, parse error at "'# still '"
I can't reproduce this locally, but I hope this'll help.
* ``cherrypy.test.webtest.WebCase`` now honors a
'WEBTEST_INTERACTIVE' environment variable to disable
interactive tests (still enabled by default). Set to '0'
or 'false' or 'False' to disable interactive tests.
* Fix AttributeError when listiterator was accessed
using the ``next`` attribute.
* Removed ``cherrypy.lib.sessions.PostgresqlSession``.
* Fix errors with redirects to Unicode URLs.
1.2.1 (2015-05-05):
- Fix false RedefinedWhileUnused for submodule imports
1.2.0 (2016-05-03):
- Warn against reusing exception names after the except: block on Python 3
- Improve the error messages for imports
- Another charmap problem. In 3.1.2 text/characters would break on
systems which had /tmp/ mounted on a different partition than the
Hypothesis storage directory (usually in home). This fixes that.
* Add support for specifying a certificate authority when serving SSL
using the built-in SSL support.
* Use ssl.create_default_context when available.
* Catch platform-specific socket errors on OS X.
* Fix parsing of URIs containing ``://`` in the path part.
Anything which used a text() or characters() strategy was broken on
Windows and I hadn't updated appveyor to use the new repository location
so I didn't notice. This is now fixed and windows support should work
correctly.
- Fix concurrency issue when running tests that use text() from multiple
processes at once
- Improve performance of code using lists with max_size
- Fix install on Python 2 with ancient versions of pip so that it
installs the enum34 backport
- Remove duplicated __all__ exports from hypothesis.strategies
- Update headers to point to new repository location.
- Allow use of strategies that can’t be used in find() (e.g. choices) in
stateful testing.
- Corrected an issue that caused the debugger not to use the
machine GUID on POSIX systems.
- Corrected an Unicode error on Python 3 for the debugger's
PIN usage.
- Corrected the timestamp verification in the pin debug code.
Without this fix the pin was remebered until too long.
- werkzeug.serving: Still show the client address on bad requests.
- improved the PIN based protection for the debugger to make it harder to
brute force via trying cookies. Please keep in mind that the debugger
*is not intended for running on production environments*
- increased the pin timeout to a week to make it less annoying for people
which should decrease the change that users disable the pin check
entirely.
- werkzeug.serving: Fix broken HTTP_HOST when path starts with double slash.
- Allow regex selector to use codes extracted from each line
- Add predefined ignore pattern # flake8: disable=<codes>
- Add environment marker selector (PEP 0496)
- Fix bug when filename selector contained trailing whitespace
- Switched to using tox-travis, and added PyPy 3 testing
This always caused problems and unneeded complexity in the past, and it
also increases Travis CI runtime.
We now require either a DISPLAY during tests or Xvfb being installed.
In 43a4a6a3e7 we added
pkg_resources._vendor.pyparsing to the frozen modules - however, older
setuptools (and thus pkg_resources) versions don't have that module yet,
so freezing would fail.
astroid
-------
2016-03-21 -- 1.4.5
* decoratornames() does not leak InferenceError anymore.
* wildcard_imported_names() got replaced by _public_names()
Our understanding of wildcard imports through __all__ was
half baked to say at least, since we couldn't account for
modifications of the list, which results in tons of false positives.
Instead, we replaced it with _public_names(), a method which returns
all the names that are publicly available in a module, that is that
don't start with an underscore, even though this means that there
is a possibility for other names to be leaked out even though
they are not present in the __all__ variable.
The method is private in 1.4.X.
pylint
------
2016-03-21 -- 1.5.5
* Let visit_importfrom from Python 3 porting checker be called when everything is disabled
Because the visit method was filtering the patterns it was expecting to be activated,
it didn't run when everything but one pattern was disabled, leading to spurious false
positives
* Don't emit unsubscriptable-value for classes with unknown
base classes.
* Use an OrderedDict for storing the configuration elements
This fixes an issue related to impredictible order of the disable / enable
elements from a config file. In certain cases, the disable was coming before
the enable which resulted in classes of errors to be enabled, even though the intention
was to disable them. The best example for this was in the context of running multiple
processes, each one of it having different enables / disables that affected the output.
* Don't consider bare and broad except handlers as ignoring NameError,
AttributeError and similar exceptions, in the context of checkers for
these issues.
- Improve error message when a plugin fails to load.
- pytest.fail with non-ascii characters raises an internal pytest error.
- junit parses report.nodeid incorrectly, when params IDs contain ::.
- SyntaxErrors containing non-ascii lines at the point of failure generated an
internal py.test error.
- When passing in a bytestring regex pattern to parameterize attempt to decode
it as utf-8 ignoring errors.
- parametrized test nodes cannot be specified to run on the command line.
[test] [feature] The default test runner is now py.test. Running “python
setup.py test” will make use of py.test instead of nose. nose still works as a
test runner as well, however.
[lexer] [bug] Major improvements to lexing of intricate Python sections which
may contain complex backslash sequences, as well as support for the bitwise
operator (e.g. pipe symbol) inside of expression sections distinct from the
Mako “filter” operator, provided the operator is enclosed within parentheses or
brackets. Pull request courtesy Daniel Martin.
[feature] Added new method Template.list_defs(). Pull request courtesy Jonathan
Vanasco.
* Bugfix for ``test_HTTP11_pipelining`` test in Python 3.5
* Bugfix regarding the keyword arguments support for Python 3 on the config
file.
* Bugfix for ``test_2_KeyboardInterrupt`` test in Python 3.5.
by monkey patching the HTTPRequest given a bug on CPython
that is affecting the testsuite (https://bugs.python.org/issue23377).
* Add additional parameter ``raise_subcls`` to the tests helpers
`openURL` and ``CPWebCase.getPage`` to have finer control on
which exceptions can be raised.
* Add support for direct keywords on the calls (e.g. ``foo=bar``) on
the config file under Python 3.
* Add additional validation to determine if the process is running
as a daemon on ``cherrypy.process.plugins.SignalHandler`` to allow
the execution of the testsuite under CI tools.
- Add a 'nothing' strategy that never successfully generates values.
- sampled_from() and one_of() can both now be called with an empty argument
list, in which case they also never generate any values.
- one_of may now be called with a single argument that is a collection of
strategies as well as as varargs.
- Add a 'runner' strategy which returns the instance of the current test object
if there is one.
- 'Bundle' for RuleBasedStateMachine is now a normal(ish) strategy and can be
used as such.
- Tests using RuleBasedStateMachine should now shrink significantly better.
- Hypothesis now uses a pretty-printing library internally, compatible with
IPython's pretty printing protocol (actually using the same code). This may
improve the quality of output in some cases.
- As a 'phases' setting that allows more fine grained control over which parts
of the process Hypothesis runs
- Add a suppress_health_check setting which allows you to turn off specific
health checks in a fine grained manner.
- Fix a bug where lists of non fixed size would always draw one more element
than they included. This mostly didn't matter, but if would cause problems
with empty strategies or ones with side effects.
- Add a mechanism to the Django model generator to allow you to explicitly
request the default value (thanks to Jeremy Thurgood for this one).
New Features
- New pytest.mark.skip mark, which unconditionally skips marked tests.
- --doctest-glob may now be passed multiple times in the command-line.
- New -rp and -rP reporting options give the summary and full output of passing
tests, respectively.
- pytest.mark.xfail now has a strict option which makes XPASS tests to fail the
test suite, defaulting to False. There’s also a xfail_strict ini option that
can be used to configure it project-wise.
- Parser.addini now supports options of type bool.
- New ALLOW_BYTES doctest option strips b prefixes from byte strings in doctest
output (similar to ALLOW_UNICODE).
- give a hint on KeyboardInterrupt to use the –fulltrace option to show the
errors
- catch IndexError exceptions when getting exception source location. This
fixes pytest internal error for dynamically generated code (fixtures and
tests) where source lines are fake by intention
Changes
- Important: py.code has been merged into the pytest repository as
pytest._code. This decision was made because py.code had very few uses
outside pytest and the fact that it was in a different repository made it
difficult to fix bugs on its code in a timely manner. The team hopes with
this to be able to better refactor out and improve that code. This change
shouldn’t affect users, but it is useful to let users aware if they encounter
any strange behavior.
Keep in mind that the code for pytest._code is private and experimental, so
you definitely should not import it explicitly!
Please note that the original py.code is still available in pylib.
- pytest_enter_pdb now optionally receives the pytest config object.
- Removed code and documentation for Python 2.5 or lower versions, including
removal of the obsolete _pytest.assertion.oldinterpret module.
- Comparisons now always show up in full when CI or BUILD_NUMBER is found in
the environment, even when -vv isn’t used.
- --lf and --ff now support long names: --last-failed and --failed-first
respectively.
- Added expected exceptions to pytest.raises fail message
- Collection only displays progress (“collecting X items”) when in a terminal.
This avoids cluttering the output when using --color=yes to obtain colors in
CI integrations systems
Bug Fixes
- The -s and -c options should now work under xdist; Config.fromdictargs now
represents its input much more faithfully.
- support Python 3.5’s @ operator in assertion rewriting.
- Fix formatting utf-8 explanation messages.
- Fix traceback style docs to describe all of the available options
(auto/long/short/line/native/no), with auto being the default since v2.6.
- junit record_xml_property doesn’t allow multiple records with same name.
- Warn if using xmlconfig.file, self.loadZCML is the preferred option.
- Avoid false reports by suffixing an opening parenthesis on all methods.
- Add decorators from zope.interface and zope.component.
Due to the bugfix we can also remove the D001 suppression.
- The ``no_xvfb``-marker is now registered automatically so pytest doesn't fail
when run with ``--strict``.
- The ``xvfb`` fixture is now session-scoped.
- PropertyMock is now accessible from mocker.
- Fix regression using one of the assert_* methods in patched functions which
receive a parameter named method.
- Remove duplication from the environment section
- Dropped support for Python 3.2
- Indicated setup and teardown in report
- Fixed colour of errors in report
- Fix version parsing of py.test to work with py.test release candidates
- More general handling of the health check problem where things could fail
because of a cache miss - now one "free" example is generated before the start
of the health check run.
- Fix a bug where Hypothesis would error when running on Python 2.7.3 or earlier
because it was trying to pass a bytearray object to struct.unpack (which is
only supported since 2.7.4).
We used to use flake8-pep257 because docstrings claims no codes are ignorable
(which is wrong). However, that doesn't work with pydocstyle, so we had a
separate pydocstyle environment (and flake8-pep257 to check tests with relaxed
rules).
Now we only use flake8-docstrings + pydocstyle (which it switches to if it's
available, even though it still depends on pep257), and drop the pydocstyle tox
env.
As soon as flake8-docstrings is updated to drop the (unneeded) pep257
dependency, we can drop it as well.
This means we can now run things like running pylint --version without having
to set PYTHONPATH correctly now.
When using skip_install=true, the plugins wouldn't work as they need to import
qutebrowser.
We have to keep setting PYTHONPATH in run_pylint_on_tests.py, otherwise we get
this error I don't quite understand:
F: 1, 0: error while code parsing: Unable to load file
'/home/florian/proj/qutebrowser/git/__init__.py' ([Errno 2] No such
file or directory: '...') (parse-error)
(3.0.2: performance fix)
------------------
3.0.1 - 2016-02-18
------------------
* Fix a case where it was possible to trigger an "Unreachable" assertion when
running certain flaky stateful tests.
* Improve shrinking of large stateful tests by eliminating a case where it was
hard to delete early steps.
* Improve efficiency of drawing binary(min_size=n, max_size=n) significantly by
provide a custom implementation for fixed size blocks that can bypass a lot
of machinery.
* Set default home directory based on the current working directory at the
point Hypothesis is imported, not whenever the function first happens to be
called.
------------------
3.0.0 - 2016-02-17
------------------
Codename: This really should have been 2.1.
Externally this looks like a very small release. It has one small breaking change
that probably doesn't affect anyone at all (some behaviour that never really worked
correctly is now outright forbidden) but necessitated a major version bump and one
visible new feature.
Internally this is a complete rewrite. Almost nothing other than the public API is
the same.
New features:
* Addition of data() strategy which allows you to draw arbitrary data interactively
within the test.
* New "exploded" database format which allows you to more easily check the example
database into a source repository while supporting merging.
* Better management of how examples are saved in the database.
* Health checks will now raise as errors when they fail. It was too easy to have
the warnings be swallowed entirely.
New limitations:
* choices and streaming strategies may no longer be used with find(). Neither may
data() (this is the change that necessitated a major version bump).
Feature removal:
* The ForkingTestCase executor has gone away. It may return in some more working
form at a later date.
Performance improvements:
* A new model which allows flatmap, composite strategies and stateful testing to
perform *much* better. They should also be more reliable.
* Filtering may in some circumstances have improved significantly. This will
help especially in cases where you have lots of values with individual filters
on them, such as lists(x.filter(...)).
* Modest performance improvements to the general test runner by avoiding expensive
operations
In general your tests should have got faster. If they've instead got significantly
slower, I'm interested in hearing about it.
Data distribution:
The data distribution should have changed significantly. This may uncover bugs the
previous version missed. It may also miss bugs the previous version could have
uncovered. Hypothesis is now producing less strongly correlated data than it used
to, but the correlations are extended over more of the structure.
Shrinking:
Shrinking quality should have improved. In particular Hypothesis can now perform
simultaneous shrinking of separate examples within a single test (previously it
was only able to do this for elements of a single collection). In some cases
performance will have improved, in some cases it will have got worse but generally
shouldn't have by much.
Switched to a new changelog format (the one in http://keepachangelog.com/)
since it was contributed by Alexander Artemenko. Re-added a newline to support
old version of Python, as requested by azjps.
* 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.
* In proxy tool, defer to Host header for resolving the base if no base is
supplied.
- Fix file modes in archive
- Support forcing a platform tag using –plat-name on pure-Python wheels, as
well as nonstandard platform tags on non-pure wheels
- Add SOABI tags to platform-specific wheels built for Python 2.X
- Support reproducible wheel files, wheels that can be rebuilt and will hash to
the same values as previous builds
- Support for changes in keyring >= 8.0
- Use the file context manager when checking if dependency_links.txt is empty,
fixes problems building wheels under PyPy on Windows
- Don’t attempt to (recursively) create a build directory ending with ..
(invalid on all platforms, but code was only executed on Windows)
- Added the PyPA Code of Conduct
Major Updates
-------------
The project was renamed to pydocstyle and the new release will be 1.0.0!
New Features
------------
- Added support for Python 3.5.
- Classes nested inside classes are no longer considered private. Nested
classes are considered public if their names are not prepended with an
underscore and if their parent class is public, recursively.
- Added the D403 error code - "First word of the first line should be properly
capitalized". This new error is turned on by default.
- Added support for .pydocstylerc and as configuration file name.
Bug Fixes
---------
- Fixed an issue where a NameError was raised when parsing complex definitions
of __all__.
- Fixed a bug where D202 was falsely reported when a function with just a
docstring and no content was followed by a comment.
- Fixed wrong __all__ definition in main module.
- Fixed a bug where an AssertionError could occur when parsing __future__
imports.
- 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.