Initial Update
This is my first visit to this fine repo so I have bundled all updates in a single pull request to make things easier for you to merge.
Close this pull request and delete the branch if you want me to start with single pull requests right away
Here's the executive summary:
Updates
Here's a list of all the updates bundled in this pull request. I've added some links to make it easier for you to find all the information you need.
| Flask | 0.10.1 | » | 0.12 | PyPI | Changelog | Repo |
| Werkzeug | 0.11.9 | » | 0.11.15 | PyPI | Changelog | Homepage |
| Jinja2 | 2.8 | » | 2.9.5 | PyPI | Changelog | Homepage |
| Flask-SQLAlchemy | 2.1 | » | 2.2 | PyPI | Changelog | Repo | Docs |
| SQLAlchemy | 1.0.13 | » | 1.1.6 | PyPI | Homepage |
| Flask-Migrate | 1.8.0 | » | 2.0.3 | PyPI | Changelog | Repo | Docs |
| Flask-WTF | 0.12 | » | 0.14.2 | PyPI | Changelog | Repo | Docs |
| Flask-Assets | 0.11 | » | 0.12 | PyPI | Changelog | Repo |
| Flask-Login | 0.2.11 | » | 0.4.0 | PyPI | Changelog | Repo | Docs |
| pytest | 3.0.6 | » | 3.0.6 | PyPI | Changelog | Homepage |
| webtest | 2.0.25 | » | 2.0.25 | PyPI | Changelog | Homepage |
| Flask-Script | 2.0.5 | » | 2.0.5 | PyPI | Changelog | Repo | Docs |
| Flask-DebugToolbar | 0.10.0 | » | 0.10.1 | PyPI | Changelog | Docs |
| boto | 2.20.0 | » | 2.46.1 | PyPI | Changelog | Repo |
Changelogs
Flask 0.10.1 -> 0.12
0.12
Released on December 21st 2016, codename Punsch.
- the cli command now responds to
--version.- Mimetype guessing and ETag generation for file-like objects in
send_filehas been removed, as per issue104. See pull request1849.- Mimetype guessing in
send_filenow fails loudly and doesn't fall back toapplication/octet-stream. See pull request1988.- Make
flask.safe_joinable to join multiple paths likeos.path.join(pull request1730).- Revert a behavior change that made the dev server crash instead of returning a Internal Server Error (pull request
2006).- Correctly invoke response handlers for both regular request dispatching as well as error handlers.
- Disable logger propagation by default for the app logger.
- Add support for range requests in
send_file.app.test_clientincludes preset default environment, which can now be directly set, instead of perclient.get.
0.11.2
Bugfix release, unreleased
- Fix crash when running under PyPy3, see pull request
1814.
0.11.1
Bugfix release, released on June 7th 2016.
- Fixed a bug that prevented
FLASK_APP=foobar/__init__.pyfrom working. See pull request1872.
0.11
Released on May 29th 2016, codename Absinthe.
- Added support to serializing top-level arrays to :func:
flask.jsonify. This introduces a security risk in ancient browsers. See :ref:json-securityfor details.- Added before_render_template signal.
- Added
**kwargsto :meth:flask.Test.test_clientto support passing additional keyword arguments to the constructor of :attr:flask.Flask.test_client_class.- Added
SESSION_REFRESH_EACH_REQUESTconfig key that controls the set-cookie behavior. If set toTruea permanent session will be refreshed each request and get their lifetime extended, if set toFalseit will only be modified if the session actually modifies. Non permanent sessions are not affected by this and will always expire if the browser window closes.- Made Flask support custom JSON mimetypes for incoming data.
- Added support for returning tuples in the form
(response, headers)from a view function.- Added :meth:
flask.Config.from_json.- Added :attr:
flask.Flask.config_class.- Added :meth:
flask.Config.get_namespace.- Templates are no longer automatically reloaded outside of debug mode. This can be configured with the new
TEMPLATES_AUTO_RELOADconfig key.- Added a workaround for a limitation in Python 3.3's namespace loader.
- Added support for explicit root paths when using Python 3.3's namespace packages.
- Added :command:
flaskand theflask.climodule to start the local debug server through the click CLI system. This is recommended over the oldflask.run()method as it works faster and more reliable due to a different design and also replacesFlask-Script.- Error handlers that match specific classes are now checked first, thereby allowing catching exceptions that are subclasses of HTTP exceptions (in
werkzeug.exceptions). This makes it possible for an extension author to create exceptions that will by default result in the HTTP error of their choosing, but may be caught with a custom error handler if desired.- Added :meth:
flask.Config.from_mapping.- Flask will now log by default even if debug is disabled. The log format is now hardcoded but the default log handling can be disabled through the
LOGGER_HANDLER_POLICYconfiguration key.- Removed deprecated module functionality.
- Added the
EXPLAIN_TEMPLATE_LOADINGconfig flag which when enabled will instruct Flask to explain how it locates templates. This should help users debug when the wrong templates are loaded.- Enforce blueprint handling in the order they were registered for template loading.
- Ported test suite to py.test.
- Deprecated
request.jsonin favour ofrequest.get_json().- Add "pretty" and "compressed" separators definitions in jsonify() method. Reduces JSON response size when JSONIFY_PRETTYPRINT_REGULAR=False by removing unnecessary white space included by default after separators.
- JSON responses are now terminated with a newline character, because it is a convention that UNIX text files end with a newline and some clients don't deal well when this newline is missing. See https://github.com/pallets/flask/pull/1262 -- this came up originally as a part of https://github.com/kennethreitz/httpbin/issues/168
- The automatically provided
OPTIONSmethod is now correctly disabled if the user registered an overriding rule with the lowercase-versionoptions(issue1288).flask.json.jsonifynow supports thedatetime.datetype (pull request1326).- Don't leak exception info of already catched exceptions to context teardown handlers (pull request
1393).- Allow custom Jinja environment subclasses (pull request
1422).flask.gnow haspop()andsetdefaultmethods.- Turn on autoescape for
flask.templating.render_template_stringby default (pull request1515).flask.extis now deprecated (pull request1484).send_from_directorynow raises BadRequest if the filename is invalid on the server OS (pull request1763).- Added the
JSONIFY_MIMETYPEconfiguration variable (pull request1728).- Exceptions during teardown handling will no longer leave bad application contexts lingering around.
0.10.2
(bugfix release, release date to be announced)
- Fixed broken
test_appcontext_signals()test case.- Raise an :exc:
AttributeErrorin :func:flask.helpers.find_packagewith a useful message explaining why it is raised when a PEP 302 import hook is used without anis_package()method.- Fixed an issue causing exceptions raised before entering a request or app context to be passed to teardown handlers.
- Fixed an issue with query parameters getting removed from requests in the test client when absolute URLs were requested.
- Made
before_first_requestinto a decorator as intended.- Fixed an etags bug when sending a file streams with a name.
- Fixed
send_from_directorynot expanding to the application root path correctly.- Changed logic of before first request handlers to flip the flag after invoking. This will allow some uses that are potentially dangerous but should probably be permitted.
- Fixed Python 3 bug when a handler from
app.url_build_error_handlersreraises theBuildError.
Werkzeug 0.11.9 -> 0.11.15
0.11.14
Released on December 30th 2016.
- Check if platform can fork before importing
ForkingMixIn, raise exception when creatingForkingWSGIServeron such a platform, see PR999.
0.11.13
Released on December 26th 2016.
- Correct fix for the reloader issuer on certain Windows installations.
0.11.12
Released on December 26th 2016.
- Fix more bugs in multidicts regarding empty lists. See
1000.- Add some docstrings to some
EnvironBuilderproperties that were previously unintentionally missing.- Added a workaround for the reloader on windows.
0.11.11
Released on August 31st 2016.
- Fix JSONRequestMixin for Python3. See 731
- Fix broken string handling in test client when passing integers. See 852
- Fix a bug in
parse_options_headerwhere an invalid content type starting with comma or semi-colon would result in an invalid return value, see issue995.- Fix a bug in multidicts when passing empty lists as values, see issue
979.- Fix a security issue that allows XSS on the Werkzeug debugger. See
1001.
0.11.10
Released on May 24th 2016.
- Fixed a bug that occurs when running on Python 2.6 and using a broken locale. See pull request 912.
- Fixed a crash when running the debugger on Google App Engine. See issue 925.
- Fixed an issue with multipart parsing that could cause memory exhaustion.
Jinja2 2.8 -> 2.9.5
2.9.5
(bugfix release, released on January 28th 2017)
- Restored the original repr of the internal
_GroupTuplebecause this caused issues with ansible and it was an unintended change. (654)- Added back support for custom contexts that override the old
resolvemethod since it was hard for people to spot that this could cause a regression.- Correctly use the buffer for the else block of for loops. This caused invalid syntax errors to be caused on 2.x and completely wrong behavior on Python 3 (669)
- Resolve an issue where the
{% extends %}tag could not be used with async environments. (668)- Reduce memory footprint slightly by reducing our unicode database dump we use for identifier matching on Python 3 (666)
- Fixed autoescaping not working for macros in async compilation mode. (671)
2.9.4
(bugfix release, released on January 10th 2017)
- Solved some warnings for string literals. (646)
- Increment the bytecode cache version which was not done due to an oversight before.
- Corrected bad code generation and scoping for filtered loops. (649)
- Resolved an issue where top-level output silencing after known extend blocks could generate invalid code when blocks where contained in if statements. (651)
- Made the
truncate.leewaydefault configurable to improve compatibility with older templates.
2.9.3
(bugfix release, released on January 8th 2017)
- Restored the use of blocks in macros to the extend that was possible before. On Python 3 it would render a generator repr instead of the block contents. (645)
- Set a consistent behavior for assigning of variables in inner scopes when the variable is also read from an outer scope. This now sets the intended behavior in all situations however it does not restore the old behavior where limited assignments to outer scopes was possible. For more information and a discussion see 641
- Resolved an issue where
block scopedwould not take advantage of the new scoping rules. In some more exotic cases a variable overriden in a local scope would not make it into a block.- Change the code generation of the
withstatement to be in line with the new scoping rules. This resolves some unlikely bugs in edge cases. This also introduces a new internalWithnode that can be used by extensions.
2.9.2
(bugfix release, released on January 8th 2017)
- Fixed a regression that caused for loops to not be able to use the same variable for the target as well as source iterator. (640)
- Add support for a previously unknown behavior of macros. It used to be possible in some circumstances to explicitly provide a caller argument to macros. While badly buggy and unintended it turns out that this is a common case that gets copy pasted around. To not completely break backwards compatibility with the most common cases it's now possible to provide an explicit keyword argument for caller if it's given an explicit default. (642)
2.9.1
(bugfix release, released on January 7th 2017)
- Resolved a regression with call block scoping for macros. Nested caller blocks that used the same identifiers as outer macros could refer to the wrong variable incorrectly.
2.9
(codename Derivation, released on January 7th 2017)
- Change cache key definition in environment. This fixes a performance regression introduced in 2.8.
- Added support for
generator_stopon supported Python versions (Python 3.5 and later)- Corrected a long standing issue with operator precedence of math operations not being what was expected.
- Added support for Python 3.6 async iterators through a new async mode.
- Added policies for filter defaults and similar things.
- urlize now sets "rel noopener" by default.
- Support attribute fallback for old-style classes in 2.x.
- Support toplevel set statements in extend situations.
- Restored behavior of Cycler for Python 3 users.
- Subtraction now follows the same behavior as other operators on undefined values.
mapand friends will now give better error messages if you forgot to quote the parameter.- Depend on MarkupSafe 0.23 or higher.
- Improved the
truncatefilter to support better truncation in case the string is barely truncated at all.- Change the logic for macro autoescaping to be based on the runtime autoescaping information at call time instead of macro define time.
- Ported a modified version of the
tojsonfilter from Flask to Jinja2 and hooked it up with the new policy framework.- Block sets are now marked
safeby default.- On Python 2 the asciification of ASCII strings can now be disabled with the
compiler.ascii_strpolicy.- Tests now no longer accept an arbitrary expression as first argument but a restricted one. This means that you can now properly use multiple tests in one expression without extra parentheses. In particular you can now write
foo is divisibleby 2 or foo is divisibleby 3as you would expect.- Greatly changed the scoping system to be more consistent with what template designers and developers expect. There is now no more magic difference between the different include and import constructs. Context is now always propagated the same way. The only remaining differences is the defaults for
with contextandwithout context.- The
withandautoescapetags are now built-in.- Added the new
select_autoescapefunction which helps configuring better autoescaping easier.
2.8.2
(bugfix release, unreleased)
- Fixed a runtime error in the sandbox when attributes of async generators were accessed.
2.8.1
(bugfix release, released on December 29th 2016)
- Fixed the
for_qsflag forurlencode.- Fixed regression when applying
intto non-string values.- SECURITY: if the sandbox mode is used format expressions are now sandboxed with the same rules as in Jinja. This solves various information leakage problems that can occur with format strings.
Flask-SQLAlchemy 2.1 -> 2.2
2.2
Released on February 27, 2017, codename Dubnium
- Minimum SQLAlchemy version is 0.8 due to use of
sqlalchemy.inspect.- Added support for custom
query_classandmodel_classas args to theSQLAlchemyconstructor. (328_)- Allow listening to SQLAlchemy events on
db.session. (364_)- Allow
__bind_key__on abstract models. (373_)- Allow
SQLALCHEMY_ECHOto be a string. (409_)- Warn when
SQLALCHEMY_DATABASE_URIis not set. (443_)- Don't let pagination generate invalid page numbers. (
460_)- Drop support of Flask < 0.10. This means the db session is always tied to the app context and its teardown event. (
461_)- Tablename generation logic no longer accesses class properties unless they are
declared_attr. (467_)
.. _328: https://github.com/mitsuhiko/flask-sqlalchemy/pull/328 .. _364: https://github.com/mitsuhiko/flask-sqlalchemy/pull/364 .. _373: https://github.com/mitsuhiko/flask-sqlalchemy/pull/373 .. _409: https://github.com/mitsuhiko/flask-sqlalchemy/pull/409 .. _443: https://github.com/mitsuhiko/flask-sqlalchemy/pull/443 .. _460: https://github.com/mitsuhiko/flask-sqlalchemy/pull/460 .. _461: https://github.com/mitsuhiko/flask-sqlalchemy/pull/461 .. _467: https://github.com/mitsuhiko/flask-sqlalchemy/pull/467
Flask-Migrate 1.8.0 -> 2.0.3
2.0.3
- Support multiple -x arguments in the Flask-Script interface (103)
2.0.2
- Support passing alembic context kwargs from constructor into init_app (138)
2.0.1
- Fix flake8 warnings in Alembic templates (136)
2.0.0
- Added Travis CI builds for Python 3.5
- Support for the new Flask CLI based on Click
1.8.1
- Allow to init_app to work correctly when db is given in constructor (118)
Flask-WTF 0.12 -> 0.14.2
0.14.2
Released 2017-01-10
- Fix bug where
FlaskFormassumedmetaargument was notNoneif it was passed. (278_)
.. _278: https://github.com/lepture/flask-wtf/issues/278
0.14.1
Released 2017-01-10
- Fix bug where the file validators would incorrectly identify an empty file as valid data. (
276,277)
FileFieldis no longer deprecated. The data is checked during processing and only set if it's a valid file.has_fileis deprecated; it's now equivalent tobool(field.data).FileRequiredandFileAllowedwork with both the Flask-WTF and WTFormsFileFieldclasses.- The
Optionalvalidator now works withFileField.
.. _276: https://github.com/lepture/flask-wtf/issues/276 .. _277: https://github.com/lepture/flask-wtf/pull/277
0.14
Released 2017-01-06
- Use itsdangerous to sign CSRF tokens and check expiration instead of doing it ourselves. (
264_)
- All tokens are URL safe, removing the
url_safeparameter fromgenerate_csrf. (206_)- All tokens store a timestamp, which is checked in
validate_csrf. Thetime_limitparameter ofgenerate_csrfis removed.
- Remove the
appattribute fromCsrfProtect, usecurrent_app. (264_)CsrfProtectprotects theDELETEmethod by default. (264_)- The same CSRF token is generated for the lifetime of a request. It is exposed as
request.csrf_tokenfor use during testing. (227,264)CsrfProtect.error_handleris deprecated. (264_)
- Handlers that return a response work in addition to those that raise an error. The behavior was not clear in previous docs.
- (
200,209,243,252)
- Use
Form.Metainstead of deprecatedSecureFormfor CSRF (and everything else). (216,271)
csrf_enabledparameter is still recognized but deprecated. All other attributes and methods fromSecureFormare removed. (271_)
- Provide
WTF_CSRF_FIELD_NAMEto configure the name of the CSRF token. (271_)validate_csrfraiseswtforms.ValidationErrorwith specific messages instead of returningTrueorFalse. This breaks anything that was calling the method directly. (239,271)
- CSRF errors are logged as well as raised. (
239_)
CsrfProtectis renamed toCSRFProtect. A deprecation warning is issued when using the old name.CsrfErroris renamed toCSRFErrorwithout deprecation. (271_)FileFieldis deprecated because it no longer provides functionality over the provided validators. Usewtforms.FileFielddirectly. (272_)
.. _
200: https://github.com/lepture/flask-wtf/issues/200 .. _209: https://github.com/lepture/flask-wtf/pull/209 .. _216: https://github.com/lepture/flask-wtf/issues/216 .. _227: https://github.com/lepture/flask-wtf/issues/227 .. _239: https://github.com/lepture/flask-wtf/issues/239 .. _243: https://github.com/lepture/flask-wtf/pull/243 .. _252: https://github.com/lepture/flask-wtf/pull/252 .. _264: https://github.com/lepture/flask-wtf/pull/264 .. _271: https://github.com/lepture/flask-wtf/pull/271 .. _272: https://github.com/lepture/flask-wtf/pull/272
0.13.1
Released 2016/10/6
- Deprecation warning for
Formis shown during__init__instead of immediately when subclassing. (262_)- Don't use
pkg_resourcesto get version, for compatibility with GAE. (261_)
.. _
261: https://github.com/lepture/flask-wtf/issues/261 .. _262: https://github.com/lepture/flask-wtf/issues/262
0.13
Released 2016/09/29
Formis renamed toFlaskFormin order to avoid name collision with WTForms's base class. UsingFormwill show a deprecation warning. (250_)hidden_tagno longer wraps the hidden inputs in a hidden div. This is valid HTML5 and any modern HTML parser will behave correctly. (217,193)flask_wtf.html5is deprecated. Import directly fromwtforms.fields.html5. (251_)is_submittedis true forPATCHandDELETEin addition toPOSTandPUT. (187_)generate_csrftakes atoken_keyparameter to specify the key stored in the session. (206_)generate_csrftakes aurl_safeparameter to allow the token to be used in URLs. (206_)form.datacan be accessed multiple times without raising an exception. (248_)- File extension with multiple parts (
.tar.gz) can be used in theFileAllowedvalidator. (201_)
.. _
187: https://github.com/lepture/flask-wtf/pull/187 .. _193: https://github.com/lepture/flask-wtf/issues/193 .. _201: https://github.com/lepture/flask-wtf/issues/201 .. _206: https://github.com/lepture/flask-wtf/pull/206 .. _217: https://github.com/lepture/flask-wtf/issues/217 .. _248: https://github.com/lepture/flask-wtf/pull/248 .. _250: https://github.com/lepture/flask-wtf/pull/250 .. _251: https://github.com/lepture/flask-wtf/pull/251
Flask-Assets 0.11 -> 0.12
0.12
- Added registration of Flask CLI commands using
flask.commandsentrypoint group. (Jiri Kuncar)- Added an optional support for FlaskAzureStorage when
FLASK_ASSETS_USE_AZUREis set. (Alejo Arias)- Updated Flask extension imports for compatibility with Flask 0.11. (Andy Driver) (fixes 102)
- Fixed generation of absolute urls using //. (fixes 73)
- Fixed Flask-Script assets build command. (Frank Tackitt)
Flask-Login 0.2.11 -> 0.4.0
0.4.0
Released on October 26th, 2016
- Fixes OPTIONS exemption from login. 244
- Fixes use of MD5 by replacing with SHA512. 264
- BREAKING: The
login_manager.token_handlerfunction,get_auth_tokenmethod on the User class, and theutils.make_secure_tokenutility function have been removed to prevent users from creating insecure auth implementations. Use theAlternative Tokensexample from the docs instead. 291
0.3.2
Released on October 8th, 2015
- Fixes Python 2.6 compatibility.
- Updates SESSION_KEYS to include "remember".
0.3.1
Released on September 30th, 2015
- Fixes removal of non-Flask-Login keys from session object when using 'strong' protection.
0.3.0
Released on September 10th, 2015
- Fixes handling of X-Forward-For header.
- Update to use SHA512 instead of MD5 for session identifier creation.
- Fixes session creation for every view.
- BREAKING: UTC used to set cookie duration.
- BREAKING: Non-fresh logins now returns HTTP 401.
- Support unicode user IDs in cookie.
- Fixes user_logged_out signal invocation.
- Support for per-Blueprint login views.
- BREAKING: The
is_authenticated,is_active, andis_anonymousmembers of the user class are now properties, not methods. Applications should update their user classes accordingly.- Various other improvements including documentation and code clean up.
pytest -> 3.0.6
3.0.6.dev0
=======================
- pytest no longer generates
PendingDeprecationWarningfrom its own operations, which was introduced by mistake in version3.0.5(2118). Thanks tonicoddemusfor the report andRonnyPfannschmidt_ for the PR.
- pytest no longer recognizes coroutine functions as yield tests (
2129). Thanks tomalinofffor the PR.
- Plugins loaded by the
PYTEST_PLUGINSenvironment variable are now automatically considered for assertion rewriting (2185). Thanksnicoddemusfor the PR.
- Improve error message when pytest.warns fails (
2150). The type(s) of the expected warnings and the list of caught warnings is added to the error message. Thankslestevefor the PR.
- Fix
pytesterinternal plugin to work correctly with latest versions ofzope.interface(1989). Thanksnicoddemusfor the PR.
- Assert statements of the
pytesterplugin again benefit from assertion rewriting (1920). ThanksRonnyPfannschmidtfor the report andnicoddemus_ for the PR.
- Specifying tests with colons like
test_foo.py::test_barfor tests in subdirectories with ini configuration files now uses the correct ini file (2148). Thankspelme.
- Fail
testdir.runpytest().assert_outcomes()explicitly if the pytest terminal output it relies on is missing. Thanks toeli-b_ for the PR.
.. _lesteve: https://github.com/lesteve .. _malinoff: https://github.com/malinoff .. _pelme: https://github.com/pelme .. _eli-b: https://github.com/eli-b
.. _2118: https://github.com/pytest-dev/pytest/issues/2118
.. _1989: https://github.com/pytest-dev/pytest/issues/1989 .. _1920: https://github.com/pytest-dev/pytest/issues/1920 .. _2129: https://github.com/pytest-dev/pytest/issues/2129 .. _2148: https://github.com/pytest-dev/pytest/issues/2148 .. _2150: https://github.com/pytest-dev/pytest/issues/2150 .. _2185: https://github.com/pytest-dev/pytest/issues/2185
3.0.5
==================
- Add warning when not passing
option=valuecorrectly to-o/--override-ini(2105). Also improved the help documentation. Thanks tombukatovfor the report andlwm_ for the PR.
- Now
--confcutdirand--junit-xmlare properly validated if they are directories and filenames, respectively (2089_ and2078). Thanks tolwmfor the PR.
- Add hint to error message hinting possible missing
__init__.py(478). ThanksDuncanBetts.
- More accurately describe when fixture finalization occurs in documentation (
687). ThanksDuncanBetts.
- Provide
:ref:targets forrecwarn.rstso we can use intersphinx referencing. Thanks todupuy_ for the report andlwm_ for the PR.
- In Python 2, use a simple
+-ASCII string in the string representation ofpytest.approx(for example"4 +- 4.0e-06") because it is brittle to handle that in different contexts and representations internally in pytest which can result in bugs such as2111. In Python 3, the representation still uses±(for example4 ± 4.0e-06). Thankskerrick-lyftfor the report andnicoddemus_ for the PR.
- Using
item.Function,item.Module, etc., is now issuing deprecation warnings, preferpytest.Function,pytest.Module, etc., instead (2034). Thanksnmundarfor the PR.
- Fix error message using
approxwith complex numbers (2082). Thanksadler-jfor the report andnicoddemus_ for the PR.
- Fixed false-positives warnings from assertion rewrite hook for modules imported more than once by the
pytest_pluginsmechanism. Thanksnicoddemus_ for the PR.
- Remove an internal cache which could cause hooks from
conftest.pyfiles in sub-directories to be called in other directories incorrectly (2016). Thanksd-b-wfor the report andnicoddemus_ for the PR.
- Remove internal code meant to support earlier Python 3 versions that produced the side effect of leaving
Noneinsys.moduleswhen expressions were evaluated by pytest (for example passing a condition as a string topytest.mark.skipif)(2103). Thanksjaracofor the report andnicoddemus_ for the PR.
- Cope gracefully with a .pyc file with no matching .py file (
2038). Thanksnedbat.
.. _adler-j: https://github.com/adler-j .. _d-b-w: https://bitbucket.org/d-b-w/ .. _DuncanBetts: https://github.com/DuncanBetts .. _dupuy: https://bitbucket.org/dupuy/ .. _kerrick-lyft: https://github.com/kerrick-lyft .. _lwm: https://github.com/lwm .. _mbukatov: https://github.com/mbukatov .. _nedbat: https://github.com/nedbat .. _nmundar: https://github.com/nmundar
.. _2016: https://github.com/pytest-dev/pytest/issues/2016 .. _2034: https://github.com/pytest-dev/pytest/issues/2034 .. _2038: https://github.com/pytest-dev/pytest/issues/2038 .. _2078: https://github.com/pytest-dev/pytest/issues/2078 .. _2082: https://github.com/pytest-dev/pytest/issues/2082 .. _2089: https://github.com/pytest-dev/pytest/issues/2089 .. _2103: https://github.com/pytest-dev/pytest/issues/2103 .. _2105: https://github.com/pytest-dev/pytest/issues/2105 .. _2111: https://github.com/pytest-dev/pytest/issues/2111 .. _478: https://github.com/pytest-dev/pytest/issues/478 .. _687: https://github.com/pytest-dev/pytest/issues/687
3.0.4
==================
- Import errors when collecting test modules now display the full traceback (
1976). Thankscwittyfor the report andnicoddemus_ for the PR.
- Fix confusing command-line help message for custom options with two or more
metavarproperties (2004). Thanksokulynyakanddavehunt_ for the report andnicoddemus_ for the PR.
- When loading plugins, import errors which contain non-ascii messages are now properly handled in Python 2 (
1998). Thanksnicoddemusfor the PR.
- Fixed cyclic reference when
pytest.raisesis used in context-manager form (1965). Also as a result of this fix,sys.exc_info()is left empty in both context-manager and function call usages. Previously,sys.exc_infowould contain the exception caught by the context manager, even when the expected exception occurred. ThanksMSeifert04for the report and the PR.
- Fixed false-positives warnings from assertion rewrite hook for modules that were rewritten but were later marked explicitly by
pytest.register_assert_rewriteor implicitly as a plugin (2005). ThanksRonnyPfannschmidtfor the report andnicoddemus_ for the PR.
- Report teardown output on test failure (
442). Thanksmatclabfor the PR.
- Fix teardown error message in generated xUnit XML. Thanks
gdyuldin_ for the PR.
- Properly handle exceptions in
multiprocessingtasks (1984). Thanksadbordenfor the report andnicoddemus_ for the PR.
- Clean up unittest TestCase objects after tests are complete (
1649). Thanksd_b_wfor the report and PR.
.. _adborden: https://github.com/adborden .. _cwitty: https://github.com/cwitty .. _d_b_w: https://github.com/d_b_w .. _gdyuldin: https://github.com/gdyuldin .. _matclab: https://github.com/matclab .. _MSeifert04: https://github.com/MSeifert04 .. _okulynyak: https://github.com/okulynyak
.. _442: https://github.com/pytest-dev/pytest/issues/442 .. _1965: https://github.com/pytest-dev/pytest/issues/1965 .. _1976: https://github.com/pytest-dev/pytest/issues/1976 .. _1984: https://github.com/pytest-dev/pytest/issues/1984 .. _1998: https://github.com/pytest-dev/pytest/issues/1998 .. _2004: https://github.com/pytest-dev/pytest/issues/2004 .. _2005: https://github.com/pytest-dev/pytest/issues/2005 .. _1649: https://github.com/pytest-dev/pytest/issues/1649
3.0.3
==================
- The
idsargument toparametrizeagain acceptsunicodestrings in Python 2 (1905). Thanksphilpepfor the report andnicoddemus_ for the PR.
- Assertions are now being rewritten for plugins in development mode (
pip install -e) (1934). Thanksnicoddemusfor the PR.
- Fix pkg_resources import error in Jython projects (
1853). Thanksraquel-uclfor the PR.
- Got rid of
AttributeError: 'Module' object has no attribute '_obj'exception in Python 3 (1944). Thanksaxilfor the PR.
- Explain a bad scope value passed to
fixturedeclarations or aMetaFunc.parametrize()call. Thankstgoodlet_ for the PR.
- This version includes
pluggy-0.4.0, which correctly handlesVersionConflicterrors in plugins (704). Thanksnicoddemusfor the PR.
.. _philpep: https://github.com/philpep .. _raquel-ucl: https://github.com/raquel-ucl .. _axil: https://github.com/axil .. _tgoodlet: https://github.com/tgoodlet
.. _1853: https://github.com/pytest-dev/pytest/issues/1853 .. _1905: https://github.com/pytest-dev/pytest/issues/1905 .. _1934: https://github.com/pytest-dev/pytest/issues/1934 .. _1944: https://github.com/pytest-dev/pytest/issues/1944 .. _704: https://github.com/pytest-dev/pytest/issues/704
3.0.2
==================
- Improve error message when passing non-string ids to
pytest.mark.parametrize(1857). Thanksokkenfor the report andnicoddemus_ for the PR.
- Add
bufferattribute to stdin stub classpytest.capture.DontReadFromInputThanksjoguSD_ for the PR.
- Fix
UnicodeEncodeErrorwhen string comparison with unicode has failed. (1864) ThanksAiOOfor the PR.
pytest_pluginsis now handled correctly if defined as a string (as opposed as a sequence of strings) when modules are considered for assertion rewriting. Due to this bug, much more modules were being rewritten than necessary if a test suite usespytest_pluginsto load internal plugins (1888). Thanksjaracofor the report andnicoddemus_ for the PR (1891_).
- Do not call tearDown and cleanups when running tests from
unittest.TestCasesubclasses with--pdbenabled. This allows proper post mortem debugging for all applications which have significant logic in their tearDown machinery (1890). Thanksmbytfor the PR.
- Fix use of deprecated
getfuncargvaluemethod in the internal doctest plugin. ThanksViviCoder_ for the report (1898_).
.. _joguSD: https://github.com/joguSD .. _AiOO: https://github.com/AiOO .. _mbyt: https://github.com/mbyt .. _ViviCoder: https://github.com/ViviCoder
.. _1857: https://github.com/pytest-dev/pytest/issues/1857 .. _1864: https://github.com/pytest-dev/pytest/issues/1864 .. _1888: https://github.com/pytest-dev/pytest/issues/1888 .. _1891: https://github.com/pytest-dev/pytest/pull/1891 .. _1890: https://github.com/pytest-dev/pytest/issues/1890 .. _1898: https://github.com/pytest-dev/pytest/issues/1898
3.0.1
==================
- Fix regression when
importorskipis used at module level (1822). ThanksjaracoandThe-Compiler_ for the report andnicoddemus_ for the PR.
- Fix parametrization scope when session fixtures are used in conjunction with normal parameters in the same call (
1832). ThanksThe-Compilerfor the report,Kingdread_ andnicoddemus_ for the PR.
- Fix internal error when parametrizing tests or fixtures using an empty
idsargument (1849). ThanksOPpuolitaivalfor the report andnicoddemus_ for the PR.
- Fix loader error when running
pytestembedded in a zipfile. Thanksmbachry_ for the PR.
.. _Kingdread: https://github.com/Kingdread .. _mbachry: https://github.com/mbachry .. _OPpuolitaival: https://github.com/OPpuolitaival
.. _1822: https://github.com/pytest-dev/pytest/issues/1822 .. _1832: https://github.com/pytest-dev/pytest/issues/1832 .. _1849: https://github.com/pytest-dev/pytest/issues/1849
3.0.0
==================
Incompatible changes
A number of incompatible changes were made in this release, with the intent of removing features deprecated for a long time or change existing behaviors in order to make them less surprising/more useful.
- Reinterpretation mode has now been removed. Only plain and rewrite mode are available, consequently the
--assert=reinterpoption is no longer available. This also means files imported from plugins orconftest.pywill not benefit from improved assertions by default, you should usepytest.register_assert_rewrite()to explicitly turn on assertion rewriting for those files. Thanksflub_ for the PR.
- The following deprecated commandline options were removed:
--genscript: no longer supported;--no-assert: use--assert=plaininstead;--nomagic: use--assert=plaininstead;--report: use-rinstead;
Thanks to
RedBeardCode_ for the PR (1664_).
- ImportErrors in plugins now are a fatal error instead of issuing a pytest warning (
1479). Thanks toThe-Compilerfor the PR.
- Removed support code for Python 3 versions < 3.3 (
1627_).
- Removed all
py.test-X*entry points. The versioned, suffixed entry points were never documented and a leftover from a pre-virtualenv era. These entry points also created broken entry points in wheels, so removing them also removes a source of confusion for users (1632). Thanksobestwalterfor the PR.
pytest.skip()now raises an error when used to decorate a test function, as opposed to its original intent (to imperatively skip a test inside a test function). Previously this usage would cause the entire module to be skipped (607). Thanksomarkohlfor the complete PR (1519_).
- Exit tests if a collection error occurs. A poll indicated most users will hit CTRL-C anyway as soon as they see collection errors, so pytest might as well make that the default behavior (
1421). A--continue-on-collection-errorsoption has been added to restore the previous behaviour. Thanksolegpidsadnyiandomarkohl_ for the complete PR (1628_).
- Renamed the pytest
pdbmodule (plugin) intodebuggingto avoid clashes with the builtinpdbmodule.
- Raise a helpful failure message when requesting a parametrized fixture at runtime, e.g. with
request.getfixturevalue. Previously these parameters were simply never defined, so a fixture decorated likepytest.fixture(params=[0, 1, 2])only ran once (460). Thanks tonikratiofor the bug report,RedBeardCode_ andtomviner_ for the PR.
_pytest.monkeypatch.monkeypatchclass has been renamed to_pytest.monkeypatch.MonkeyPatchso it doesn't conflict with themonkeypatchfixture.
--exitfirst / -xcan now be overridden by a following--maxfail=Nand is just a synonym for--maxfail=1.
New Features
- Support nose-style
__test__attribute on methods of classes, including unittest-style Classes. If set toFalse, the test will not be collected.
- New
doctest_namespacefixture for injecting names into the namespace in which doctests run. Thanksmilliams_ for the complete PR (1428_).
- New
--doctest-reportoption available to change the output format of diffs when running (failing) doctests (implements1749). Thankshartymfor the PR.
- New
nameargument topytest.fixturedecorator which allows a custom name for a fixture (to solve the funcarg-shadowing-fixture problem). Thanksnovas0x2a_ for the complete PR (1444_).
- New
approx()function for easily comparing floating-point numbers in tests. Thankskalekundert_ for the complete PR (1441_).
- Ability to add global properties in the final xunit output file by accessing the internal
junitxmlplugin (experimental). Thankstareqalayan_ for the complete PR1454_).
- New
ExceptionInfo.match()method to match a regular expression on the string representation of an exception (372). Thanksomarkohlfor the complete PR (1502_).
__tracebackhide__can now also be set to a callable which then can decide whether to filter the traceback based on theExceptionInfoobject passed to it. ThanksThe-Compiler_ for the complete PR (1526_).
- New
pytest_make_parametrize_id(config, val)hook which can be used by plugins to provide friendly strings for custom types. Thankspalaviv_ for the PR.
capsysandcapfdnow have adisabled()context-manager method, which can be used to temporarily disable capture within a test. Thanksnicoddemus_ for the PR.
- New cli flag
--fixtures-per-test: shows which fixtures are being used for each selected test item. Features doc strings of fixtures by default. Can also show where fixtures are defined if combined with-v. Thankshackebrot_ for the PR.
- Introduce
pytestcommand as recommended entry point. Note thatpy.teststill works and is not scheduled for removal. Closes proposal1629. Thanksobestwalteranddavehunt_ for the complete PR (1633_).
- New cli flags:
--setup-plan: performs normal collection and reports the potential setup and teardown and does not execute any fixtures and tests;--setup-only: performs normal collection, executes setup and teardown of fixtures and reports them;--setup-show: performs normal test execution and additionally shows setup and teardown of fixtures;--keep-duplicates: py.test now ignores duplicated paths given in the command line. To retain the previous behavior where the same test could be run multiple times by specifying it in the command-line multiple times, pass the--keep-duplicatesargument (1609_);
Thanks
d6e,kvas-it,sallner,ioggstreamandomarkohl_ for the PRs.
- New CLI flag
--override-ini/-o: overrides values from the ini file. For example:"-o xfail_strict=True"'. Thanksblueyed_ andfengxx_ for the PR.
- New hooks:
pytest_fixture_setup(fixturedef, request): executes fixture setup;pytest_fixture_post_finalizer(fixturedef): called after the fixture's finalizer and has access to the fixture's result cache.
Thanks
d6e,sallner.
- Issue warnings for asserts whose test is a tuple literal. Such asserts will never fail because tuples are always truthy and are usually a mistake (see
1562). Thankskvas-it, for the PR.
- Allow passing a custom debugger class (e.g.
--pdbcls=IPython.core.debugger:Pdb). Thanks toanntzer_ for the PR.
Changes
- Plugins now benefit from assertion rewriting. Thanks
sober7,nicoddemusandflub_ for the PR.
- Change
report.outcomeforxpassedtests to"passed"in non-strict mode and"failed"in strict mode. Thanks tohackebrot_ for the PR (1795) andgprasad84for report (1546_).
- Tests marked with
xfail(strict=False)(the default) now appear in JUnitXML reports as passing tests instead of skipped. Thanks tohackebrot_ for the PR (1795_).
- Highlight path of the file location in the error report to make it easier to copy/paste. Thanks
suzaku_ for the PR (1778_).
- Fixtures marked with
pytest.fixturecan now useyieldstatements exactly like those marked with thepytest.yield_fixturedecorator. This change renderspytest.yield_fixturedeprecated and makespytest.fixturewithyieldstatements the preferred way to write teardown code (1461). Thankscsaftoiufor bringing this to attention andnicoddemus_ for the PR.
- Explicitly passed parametrize ids do not get escaped to ascii (
1351). Thanksceridwenfor the PR.
- Fixtures are now sorted in the error message displayed when an unknown fixture is declared in a test function. Thanks
nicoddemus_ for the PR.
pytest_terminal_summaryhook now receives theexitstatusof the test session as argument. Thanksblueyed_ for the PR (1809_).
- Parametrize ids can accept
Noneas specific test id, in which case the automatically generated id for that argument will be used. Thankspalaviv_ for the complete PR (1468_).
- The parameter to xunit-style setup/teardown methods (
setup_method,setup_module, etc.) is now optional and may be omitted. Thanksokken_ for bringing this to attention andnicoddemus_ for the PR.
- Improved automatic id generation selection in case of duplicate ids in parametrize. Thanks
palaviv_ for the complete PR (1474_).
- Now pytest warnings summary is shown up by default. Added a new flag
--disable-pytest-warningsto explicitly disable the warnings summary (1668_).
- Make ImportError during collection more explicit by reminding the user to check the name of the test module/package(s) (
1426). Thanksomarkohlfor the complete PR (1520_).
- Add
build/anddist/to the default--norecursedirslist. Thanksmikofski_ for the report andtomviner_ for the PR (1544_).
pytest.raisesin the context manager form accepts a custommessageto raise when no exception occurred. Thankspalaviv_ for the complete PR (1616_).
conftest.pyfiles now benefit from assertion rewriting; previously it was only available for test modules. Thanksflub,sober7andnicoddemus_ for the PR (1619_).
- Text documents without any doctests no longer appear as "skipped". Thanks
graingert_ for reporting and providing a full PR (1580_).
- Ensure that a module within a namespace package can be found when it is specified on the command line together with the
--pyargsoption. Thanks totaschini_ for the PR (1597_).
- Always include full assertion explanation during assertion rewriting. The previous behaviour was hiding sub-expressions that happened to be
False, assuming this was redundant information. Thanksbagerard_ for reporting (1503). Thanks todavehuntandtomviner_ for the PR.
OptionGroup.addoption()now checks if option names were already added before, to make it easier to track down issues like1618_. Before, you only got exceptions later fromargparselibrary, giving no clue about the actual reason for double-added options.
yield-based tests are considered deprecated and will be removed in pytest-4.0. Thanksnicoddemus_ for the PR.
[pytest]sections insetup.cfgfiles should now be named[tool:pytest]to avoid conflicts with other distutils commands (see567).[pytest]sections inpytest.iniortox.inifiles are supported and unchanged. Thanksnicoddemusfor the PR.
- Using
pytest_funcarg__prefix to declare fixtures is considered deprecated and will be removed in pytest-4.0 (1684). Thanksnicoddemusfor the PR.
- Passing a command-line string to
pytest.main()is considered deprecated and scheduled for removal in pytest-4.0. It is recommended to pass a list of arguments instead (1723_).
- Rename
getfuncargvaluetogetfixturevalue.getfuncargvalueis still present but is now considered deprecated. Thanks toRedBeardCode_ andtomviner_ for the PR (1626_).
optparsetype usage now triggers DeprecationWarnings (1740_).
optparsebackward compatibility supports float/complex types (457_).
- Refined logic for determining the
rootdir, considering only valid paths which fixes a number of issues:1594,1435and1471. Updated the documentation according to current behavior. Thanks toblueyed,davehunt_ andmatthiasha_ for the PR.
- Always include full assertion explanation. The previous behaviour was hiding sub-expressions that happened to be False, assuming this was redundant information. Thanks
bagerard_ for reporting (1503). Thanks todavehuntandtomviner_ for PR.
- Better message in case of not using parametrized variable (see
1539). Thanks totramwaj29for the PR.
- Updated docstrings with a more uniform style.
- Add stderr write for
pytest.exit(msg)during startup. Previously the message was never shown. ThanksBeyondEvil_ for reporting1210. Thanks toJonathonSonesenandtomviner_ for the PR.
- No longer display the incorrect test deselection reason (
1372). Thanksronnypfannschmidtfor the PR.
- The
--resultlogcommand line option has been deprecated: it is little used and there are more modern and better alternatives (see830). Thanksnicoddemusfor the PR.
- Improve error message with fixture lookup errors: add an 'E' to the first line and '>' to the rest. Fixes
717. Thanksblueyedfor reporting and a PR,eolo999_ for the initial PR andtomviner_ for his guidance during EuroPython2016 sprint.
Bug Fixes
- Parametrize now correctly handles duplicated test ids.
- Fix internal error issue when the
methodargument is missing forteardown_method()(1605_).
- Fix exception visualization in case the current working directory (CWD) gets deleted during testing (
1235). Thanksbukzorfor reporting. PR bymarscher_.
- Improve test output for logical expression with brackets (
925). ThanksDRMacIverfor reporting andRedBeardCode_ for the PR.
- Create correct diff for strings ending with newlines (
1553). ThanksVogtinatorfor reporting andRedBeardCode_ andtomviner_ for the PR.
ConftestImportFailurenow shows the traceback making it easier to identify bugs inconftest.pyfiles (1516). Thankstxomonfor the PR.
- Text documents without any doctests no longer appear as "skipped". Thanks
graingert_ for reporting and providing a full PR (1580_).
- Fixed collection of classes with custom
__new__method. Fixes1579. Thanks toStranger6667for the PR.
- Fixed scope overriding inside metafunc.parametrize (
634). Thanks toStranger6667for the PR.
- Fixed the total tests tally in junit xml output (
1798). Thanks tocryporchildfor the PR.
- Fixed off-by-one error with lines from
request.node.warn. Thanks toblueyed_ for the PR.
.. _1210: https://github.com/pytest-dev/pytest/issues/1210 .. _1235: https://github.com/pytest-dev/pytest/issues/1235 .. _1351: https://github.com/pytest-dev/pytest/issues/1351 .. _1372: https://github.com/pytest-dev/pytest/issues/1372 .. _1421: https://github.com/pytest-dev/pytest/issues/1421 .. _1426: https://github.com/pytest-dev/pytest/issues/1426 .. _1428: https://github.com/pytest-dev/pytest/pull/1428 .. _1435: https://github.com/pytest-dev/pytest/issues/1435 .. _1441: https://github.com/pytest-dev/pytest/pull/1441 .. _1444: https://github.com/pytest-dev/pytest/pull/1444 .. _1454: https://github.com/pytest-dev/pytest/pull/1454 .. _1461: https://github.com/pytest-dev/pytest/pull/1461 .. _1468: https://github.com/pytest-dev/pytest/pull/1468 .. _1471: https://github.com/pytest-dev/pytest/issues/1471 .. _1474: https://github.com/pytest-dev/pytest/pull/1474 .. _1479: https://github.com/pytest-dev/pytest/issues/1479 .. _1502: https://github.com/pytest-dev/pytest/pull/1502 .. _1503: https://github.com/pytest-dev/pytest/issues/1503 .. _1516: https://github.com/pytest-dev/pytest/pull/1516 .. _1519: https://github.com/pytest-dev/pytest/pull/1519 .. _1520: https://github.com/pytest-dev/pytest/pull/1520 .. _1526: https://github.com/pytest-dev/pytest/pull/1526 .. _1539: https://github.com/pytest-dev/pytest/issues/1539 .. _1544: https://github.com/pytest-dev/pytest/issues/1544 .. _1546: https://github.com/pytest-dev/pytest/issues/1546 .. _1553: https://github.com/pytest-dev/pytest/issues/1553 .. _1562: https://github.com/pytest-dev/pytest/issues/1562 .. _1579: https://github.com/pytest-dev/pytest/issues/1579 .. _1580: https://github.com/pytest-dev/pytest/pull/1580 .. _1594: https://github.com/pytest-dev/pytest/issues/1594 .. _1597: https://github.com/pytest-dev/pytest/pull/1597 .. _1605: https://github.com/pytest-dev/pytest/issues/1605 .. _1616: https://github.com/pytest-dev/pytest/pull/1616 .. _1618: https://github.com/pytest-dev/pytest/issues/1618 .. _1619: https://github.com/pytest-dev/pytest/issues/1619 .. _1626: https://github.com/pytest-dev/pytest/pull/1626 .. _1627: https://github.com/pytest-dev/pytest/pull/1627 .. _1628: https://github.com/pytest-dev/pytest/pull/1628 .. _1629: https://github.com/pytest-dev/pytest/issues/1629 .. _1632: https://github.com/pytest-dev/pytest/issues/1632 .. _1633: https://github.com/pytest-dev/pytest/pull/1633 .. _1664: https://github.com/pytest-dev/pytest/pull/1664 .. _1668: https://github.com/pytest-dev/pytest/issues/1668 .. _1684: https://github.com/pytest-dev/pytest/pull/1684 .. _1723: https://github.com/pytest-dev/pytest/pull/1723 .. _1740: https://github.com/pytest-dev/pytest/issues/1740 .. _1749: https://github.com/pytest-dev/pytest/issues/1749 .. _1778: https://github.com/pytest-dev/pytest/pull/1778 .. _1795: https://github.com/pytest-dev/pytest/pull/1795 .. _1798: https://github.com/pytest-dev/pytest/pull/1798 .. _1809: https://github.com/pytest-dev/pytest/pull/1809 .. _372: https://github.com/pytest-dev/pytest/issues/372 .. _457: https://github.com/pytest-dev/pytest/issues/457 .. _460: https://github.com/pytest-dev/pytest/pull/460 .. _567: https://github.com/pytest-dev/pytest/pull/567 .. _607: https://github.com/pytest-dev/pytest/issues/607 .. _634: https://github.com/pytest-dev/pytest/issues/634 .. _717: https://github.com/pytest-dev/pytest/issues/717 .. _830: https://github.com/pytest-dev/pytest/issues/830 .. _925: https://github.com/pytest-dev/pytest/issues/925
.. _anntzer: https://github.com/anntzer .. _bagerard: https://github.com/bagerard .. _BeyondEvil: https://github.com/BeyondEvil .. _blueyed: https://github.com/blueyed .. _ceridwen: https://github.com/ceridwen .. _cryporchild: https://github.com/cryporchild .. _csaftoiu: https://github.com/csaftoiu .. _d6e: https://github.com/d6e .. _davehunt: https://github.com/davehunt .. _DRMacIver: https://github.com/DRMacIver .. _eolo999: https://github.com/eolo999 .. _fengxx: https://github.com/fengxx .. _flub: https://github.com/flub .. _gprasad84: https://github.com/gprasad84 .. _graingert: https://github.com/graingert .. _hartym: https://github.com/hartym .. _JonathonSonesen: https://github.com/JonathonSonesen .. _kalekundert: https://github.com/kalekundert .. _kvas-it: https://github.com/kvas-it .. _marscher: https://github.com/marscher .. _mikofski: https://github.com/mikofski .. _milliams: https://github.com/milliams .. _nikratio: https://github.com/nikratio .. _novas0x2a: https://github.com/novas0x2a .. _obestwalter: https://github.com/obestwalter .. _okken: https://github.com/okken .. _olegpidsadnyi: https://github.com/olegpidsadnyi .. _omarkohl: https://github.com/omarkohl .. _palaviv: https://github.com/palaviv .. _RedBeardCode: https://github.com/RedBeardCode .. _sallner: https://github.com/sallner .. _sober7: https://github.com/sober7 .. _Stranger6667: https://github.com/Stranger6667 .. _suzaku: https://github.com/suzaku .. _tareqalayan: https://github.com/tareqalayan .. _taschini: https://github.com/taschini .. _tramwaj29: https://github.com/tramwaj29 .. _txomon: https://github.com/txomon .. _Vogtinator: https://github.com/Vogtinator .. _matthiasha: https://github.com/matthiasha
2.9.2
==================
Bug Fixes
- fix
510: skip tests where one parameterize dimension was empty thanks Alex Stapleton for the Report andRonnyPfannschmidtfor the PR
- Fix Xfail does not work with condition keyword argument. Thanks
astraw38_ for reporting the issue (1496) andtomvinerfor PR the (1524_).
- Fix win32 path issue when putting custom config file with absolute path in
pytest.main("-c your_absolute_path").
- Fix maximum recursion depth detection when raised error class is not aware of unicode/encoded bytes. Thanks
prusse-martin_ for the PR (1506_).
- Fix
pytest.mark.skipmark when used in strict mode. Thankspquentin_ for the PR andRonnyPfannschmidt_ for showing how to fix the bug.
- Minor improvements and fixes to the documentation. Thanks
omarkohl_ for the PR.
- Fix
--fixturesto show all fixture definitions as opposed to just one per fixture name. Thanks tohackebrot_ for the PR.
.. _510: https://github.com/pytest-dev/pytest/issues/510 .. _1506: https://github.com/pytest-dev/pytest/pull/1506 .. _1496: https://github.com/pytest-dev/pytest/issues/1496 .. _1524: https://github.com/pytest-dev/pytest/pull/1524
.. _prusse-martin: https://github.com/prusse-martin .. _astraw38: https://github.com/astraw38
2.9.1
==================
Bug Fixes
- Improve error message when a plugin fails to load. Thanks
nicoddemus_ for the PR.
- Fix (
1178 <https://github.com/pytest-dev/pytest/issues/1178>):pytest.failwith non-ascii characters raises an internal pytest error. Thanksnicoddemusfor the PR.
- Fix (
469): junit parses report.nodeid incorrectly, when params IDs contain::. Thankstomvinerfor the PR (1431_).
- Fix (
578 <https://github.com/pytest-dev/pytest/issues/578>): SyntaxErrors containing non-ascii lines at the point of failure generated an internal py.test error. Thanksasottilefor the report andnicoddemus_ for the PR.
- Fix (
1437_): When passing in a bytestring regex pattern to parameterize attempt to decode it as utf-8 ignoring errors.
- Fix (
649_): parametrized test nodes cannot be specified to run on the command line.
- Fix (
138_): better reporting for python 3.3+ chained exceptions
.. _1437: https://github.com/pytest-dev/pytest/issues/1437 .. _469: https://github.com/pytest-dev/pytest/issues/469 .. _1431: https://github.com/pytest-dev/pytest/pull/1431 .. _649: https://github.com/pytest-dev/pytest/issues/649 .. _138: https://github.com/pytest-dev/pytest/issues/138
.. _asottile: https://github.com/asottile
2.9.0
==================
New Features
- New
pytest.mark.skipmark, which unconditionally skips marked tests. ThanksMichaelAquilina_ for the complete PR (1040_).
--doctest-globmay now be passed multiple times in the command-line. Thanksjab_ andnicoddemus_ for the PR.
- New
-rpand-rPreporting options give the summary and full output of passing tests, respectively. Thanks tocodewarrior0_ for the PR.
pytest.mark.xfailnow has astrictoption, which makesXPASStests to fail the test suite (defaulting toFalse). There's also axfail_strictini option that can be used to configure it project-wise. Thanksrabbbit_ for the request andnicoddemus_ for the PR (1355_).
Parser.addininow supports options of typebool. Thanksnicoddemus_ for the PR.
- New
ALLOW_BYTESdoctest option. This stripsbprefixes from byte strings in doctest output (similar toALLOW_UNICODE). Thanksjaraco_ for the request andnicoddemus_ for the PR (1287_).
- Give a hint on
KeyboardInterruptto use the--fulltraceoption to show the errors. Fixes1366. Thanks tohpk42for the report andRonnyPfannschmidt_ for the PR.
- Catch
IndexErrorexceptions when getting exception source location. Fixes a pytest internal error for dynamically generated code (fixtures and tests) where source lines are fake by intention.
Changes
- Important:
py.code <https://pylib.readthedocs.io/en/latest/code.html>_ has been merged into thepytestrepository aspytest._code. This decision was made becausepy.codehad very few uses outsidepytestand the fact that it was in a different repository made it difficult to fi
documentation on how to install