- Fixed regression causing spurious errors when xdist was used.
- Fixed DeprecationWarning about incorrect addoption use.
- Fixed deprecated use of funcarg fixture API.
- Try to import mock first instead of unittest.mock. This gives the user
flexibility to install a newer mock version from PyPI instead of using
the one available in the Python distribution.
- mock.sentinel is now aliased as mocker.sentinel for convenience.
See #1702.
Breaking Changes
With pytest-qt 2.0, we changed some defaults to values we think are much
better, however this required some backwards-incompatible changes:
- pytest-qt now defaults to using PyQt5 if PYTEST_QT_API is not set.
Before, it preferred PySide which is using the discontinued Qt4.
- Python 3 versions prior to 3.4 are no longer supported.
- The @pytest.mark.qt_log_ignore mark now defaults to extend=True, i.e.
extends the patterns defined in the config file rather than overriding
them. You can pass extend=False to get the old behaviour of overriding
the patterns.
- qtbot.waitSignal now defaults to raising=True and raises an exception
on timeouts. You can set qt_wait_signal_raising = false in your config
to get back the old behaviour.
- PYTEST_QT_FORCE_PYQT environment variable is no longer supported. Set
PYTEST_QT_API to the appropriate value instead or the new qt_api
configuration option in your pytest.ini file.
New Features
- From this version onward, pytest-qt is licensed under the MIT license.
- New qtmodeltester fixture to test QAbstractItemModel subclasses.
- waitSignal and waitSignals can receive an optional callback that can
evaluate if the arguments of emitted signals should resume execution
or not.
- Now which Qt binding pytest-qt will use can be configured by the
qt_api config option.
- While pytestqt.qt_compat is an internal module and shouldn't be
imported directly, it is known that some test suites did import it.
This module now uses a lazy-load mechanism to load Qt classes and
objects, so the old symbols (QtCore, QApplication, etc.) are no longer
available from it.
Other Changes
- Exceptions caught by pytest-qt in sys.excepthook are now also printed
to stderr, making debugging them easier from within an IDE.
Version 4.2
------------
- Since concurrency=multiprocessing uses subprocesses, options specified
on the coverage.py command line will not be communicated down to them.
Only options in the configuration file will apply to the subprocesses.
Previously, the options didn't apply to the subprocesses, but there
was no indication. Now it is an error to use
--concurrency=multiprocessing and other run-affecting options on the
command line. This prevents failures like those reported in issue 495.
- Filtering the HTML report is now faster, thanks to Ville Skyttä.
Version 4.2b1
-------------
Work from the PyCon 2016 Sprints!
- BACKWARD INCOMPATIBILITY: the coverage combine command now ignores an
existing .coverage data file. It used to include that file in its
combining. This caused confusing results, and extra tox "clean" steps.
If you want the old behavior, use the new coverage combine --append
option.
- The concurrency option can now take multiple values, to support
programs using multiprocessing and another library such as eventlet.
This is only possible in the configuration file, not from the command
line. The configuration file is the only way for sub-processes to all
run with the same options.
- Using a concurrency setting of multiprocessing now implies --parallel
so that the main program is measured similarly to the sub-processes.
- When using automatic subprocess measurement, running coverage commands
would create spurious data files. This is now fixed.
- A new configuration option, report:sort, controls what column of the
text report is used to sort the rows.
- The HTML report has a more-visible indicator for which column is being
sorted.
- If the HTML report cannot find the source for a file, the message now
suggests using the -i flag to allow the report to continue.
- When reports are ignoring errors, there's now a warning if a file
cannot be parsed, rather than being silently ignored.
- A new option for coverage debug is available: coverage debug config
shows the current configuration.
- Running coverage as a module (python -m coverage) no longer shows the
program name as __main__.py.
- The test_helpers module has been moved into a separate pip-installable
package: unittest-mixins.
* Add `returns` into the proper order in FunctionDef._astroid_fields
The order is important, since it determines the last child,
which in turn determines the last line number of a scoped node.
1.0.1
-----
Make sure this works out of the box (is enabled by default) with
Flake8 3.0
1.0.0
-----
Switch dependency name to pydocstyle. pep257 was renamed to pydocstyle,
this update switches the requirement to that new package name. Since
we’re swapping out dependencies, we’ve issued a major version bump.
On most platforms (according to shellcheck), you can't pass two
arguments in a shebang. I.e. on Debian you get:
/usr/bin/env: ‘bash -e’: No such file or directory
Implement systemd's socket activation mechanism for CherryPy servers,
based on work sponsored by Endless Computers.
Socket Activation allows one to setup a system so that systemd will sit
on a port and start services 'on demand' (a little bit like inetd and
xinetd used to do).
7.0.0
-----
Removed the long-deprecated backward compatibility for
legacy config keys in the engine. Use the config for the
namespaced-plugins instead:
- autoreload_on -> autoreload.on
- autoreload_frequency -> autoreload.frequency
- autoreload_match -> autoreload.match
- reload_files -> autoreload.files
- deadlock_poll_frequency -> timeout_monitor.frequency
6.2.1
-----
Fix KeyError in Bus.publish when signal handlers set in config.
* Beautiful Soup is no longer compatible with Python 2.6. This
actually happened a few releases ago, but it's now official.
* Beautiful Soup will now work with versions of html5lib greater than
0.99999999.
* If a search against each individual value of a multi-valued
attribute fails, the search will be run one final time against the
complete attribute value considered as a single string. That is, if
a tag has class="foo bar" and neither "foo" nor "bar" matches, but
"foo bar" does, the tag is now considered a match.
This happened in previous versions, but only when the value being
searched for was a string. Now it also works when that value is
a regular expression, a list of strings, etc.
* Fixed a bug that deranged the tree when a whitespace element was
reparented into a tag that contained an identical whitespace
element.
* Added support for CSS selector values that contain quoted spaces,
such as tag[style="display: foo"].
* Corrected handling of XML processing instructions.
* Corrected an encoding error that happened when a BeautifulSoup
object was copied.
* The contents of <textarea> tags will no longer be modified when the
tree is prettified.
* When a BeautifulSoup object is pickled but its tree builder cannot
be pickled, its .builder attribute is set to None instead of being
destroyed. This avoids a performance problem once the object is
unpickled.
* Specify the file and line number when warning about a
BeautifulSoup object being instantiated without a parser being
specified.
* The `limit` argument to `select()` now works correctly, though it's
not implemented very efficiently.
* Fixed a Python 3 ByteWarning when a URL was passed in as though it
were markup. Thanks to James Salter for a patch and
test.
* We don't run the check for a filename passed in as markup if the
'filename' contains a less-than character; the less-than character
indicates it's most likely a very small document.
* Recurse into all the ancestors when checking if an object is an exception
Since we were going only into the first level, we weren't inferring
when a class used a metaclass which defined a base Exception class
for the aforementioned class.
* Added tool to automatically convert request params based on type
annotations (primarily in Python 3). For example:
@cherrypy.tools.params()
def resource(self, limit: int):
assert isinstance(limit, int)
* Do not crash when printing the help of options with default regular
expressions
* More granular versions for deprecated modules.
* Do not crash in docparams when we can't infer the exception types.
- Test functions defined using @given can now be called from other
threads
- Attempting to delete a settings property would previously have
silently done the wrong thing. Now it raises an AttributeError.
- Creating a settings object with a custom database_file parameter was
silently getting ignored and the default was being used instead. Now
it’s not.
We've had many checks disabled - these are the ones we actually lose:
L104
Docstrings must use Napoleon, not reStructuredText fields.
L205
__init__.py is not allowed to contain function or class definitions.
L206
Implicit relative imports are not allowed.
L208
Pokémon exception handling is always a mistake. If the intent is
really to catch and ignore exceptions, explicitly name which
exception types to silence.
L209
return, del, raise, assert, print (in python 2, without
print_function) yield, and yield from are statements, not functions,
and as such, do not require parentheses.
L210
Instead of intentionally relying on the side effects of map, filter,
or a comprehension, write an explicit for loop.
L211
Using map or filter with a lambda as the first argument is always
better written as list comprehension or generator expression. An
expression is more readable and extensible, and less importantly,
doesn't incur as much function call overhead.
L212
Using @staticmethod is always wrong.
L301
Files must end with a trailing newline.
L303
noqa is ignored, and as such, # noqa comments should be deleted to
reduce pointless noise.
However, most of those are also checked by pylint (and the rest I don't
really care about), and ebb-lint increases flake8's runtime a lot
(45s -> almost 2min).
- Microsoft Windows filename selector fixes, with Appveyor CI testing
- Allow multiple codes to be disabled by per-line comments
- Allow comment after each rule line
- Prevent use with flake8 v3
- Support both pep8 and pycodestyle in test suite
Closes#1632.
new: mccabe
new: isort
deleted: colorama
astroid 1.4.7
-------------
* Stop saving assignment locals in ExceptHandlers, when the context is a store.
This fixes a tripping case, where the RHS of a ExceptHandler can be redefined
by the LHS, leading to a local save. For instance, ``except KeyError, exceptions.IndexError``
could result in a local save for IndexError as KeyError, resulting in potential unexpected
inferences. Since we don't lose a lot, this syntax gets prohibited.
pylint 1.6.0
------------
* Added a new extension, `pylint.extensions.mccabe`, for warning
about complexity in code.
* Deprecate support for --optimize-ast.
* Deprecate support for the HTML output.
* Deprecate support for --output-files.
* Fixed a documentation error for the check_docs extension.
* Made the list of property-defining decorators configurable.
* Fix a bug where the top name of a qualified import was detected as unused variable.
* bad-builtin is now an extension check.
* generated-members support qualified name through regular expressions.
For instance, one can specify a regular expression as --generated-members=astroid.node_classes.*
for ignoring every no-member error that is accessed as in `astroid.node_classes.missing.object`.
* Add the ability to ignore files based on regex matching, with the new ``--ignore-patterns``
option.
This allows for multiple ignore patterns to be specified. Rather than
clobber the existing ignore option, we introduced a new one called
ignore-patterns.
* Added a new error, 'trailing-newlines', which is emitted when a file
has trailing new lines.
* Add a new option, 'redefining-builtins-modules', for controlling the modules
which can redefine builtins, such as six.moves and future.builtins.
* 'reimported' is emitted when the same name is imported from different module.
* Add a new recommendation checker, 'consider-iterating-dictionary', which is emitted
which is emitted when a dictionary is iterated through .keys().
* Use the configparser backport for Python 2
This fixes a problem we were having with comments inside values, which is fixed
in Python 3's configparser.
* A new error was added, 'invalid-length-returned', when the `__len__`
special method returned something else than a non-negative number.
* Switch to using isort internally for wrong-import-order.
* check_docs extension can find constructor parameters in __init__.
* Don't warn about invalid-sequence-index if the indexed object has unknown base
classes.
* Don't crash when checking, for super-init-not-called, a method defined in an if block.
* Do not emit import-error or no-name-in-module for fallback import blocks by default.
Until now, we warned with these errors when a fallback import block (a TryExcept block
that contained imports for Python 2 and 3) was found, but this gets cumbersome when
trying to write compatible code. As such, we don't check these blocks by default,
but the analysis can be enforced by using the new ``--analyse-fallback-block`` flag.
pylint 1.6.1
------------
* Use environment markers for supporting conditional dependencies.
On Windows when running two Hypothesis processes in parallel (e.g. using
pytest-xdist) they could race with each other and one would raise an
exception due to the non-atomic nature of file renaming on Windows and
the fact that you can't rename over an existing file. This is now fixed.
- Add support for specifying output location for html, xml, and annotate
report.
- Fix bug hiding test failure when cov-fail-under failed.
- For coverage >= 4.0, match the default behaviour of coverage report
and error if coverage fails to find the source instead of just
printing a warning.
- Fixed bug occurred when bare --cov parameter was used with xdist.
- Add support for skip_covered and added --cov-report=term-skip-covered
command line options.
- Rename pep8 to pycodestyle.
- Add support for python 3.5.
- Add flake8 pypi classifier.
- Drop python 3.3 and 3.4 support (only testing it probably works just
fine).
- Fix travis and coveralls to work properly with python 3.5.
The `taskadd` userscript adds a task based on the current title and URL.
It passes additional arguments along to `task`.
For example:
:spawn --userscript taskadd due:eod pri:H
will add a task with high priority due at the end of the day.
The description will be the current page title and it will be annotated
with the current page url.
If used with hints, the hint text is used as the description.
Unfortunately, there is currently no way to use :hint fill and maintain
the hint text, which limits the ability to provide additional args in
hint mode.
- I201 rule that allows you to configure complaining about certain
modules being imported, e.g. if you are moving from Python 2 to 3 you
could stop urlparse being imported in favour of
six.moves.urllib.parse.
* Don't flag attributes as unused if they are used as global variables in
another module.
* Don't consider "True" and "False" variable names.
* Abort with error message when invoked on .pyc files.
This means we can remove the whitelisted globals in run_vulture.py and
the associated xfailing test.
We also needed to adjust run_vulture.py slightly as the file attribute
got renamed to filename.
- Update the config files to search for to include setup.cfg and
tox.ini. This was broken in 2.5.5 when we stopped passing config_file
to our Style Guide
flake8 2.6.0
------------
- Switch to pycodestyle as all future pep8 releases will use that
package name
- Allow for Windows users on select versions of Python to use --jobs and
multiprocessing
- Update bounds on McCabe
- Update bounds on PyFlakes and blacklist known broken versions
- Handle new PyFlakes warning with a new error code: F405
flake8-copyright 0.1.1
----------------------
- Set line & column to 1,1 to avoid a flake8 error
- Support multi-year copyright notices
flake8-docstrings 0.2.8
-----------------------
- Try to import pydocstyle (not pycodestyle) as pep257
- Import either pycodestyle or pep8 to use stdin_get_value. This fixes
the problem for newer Flake8’s (2.6.0+) and older ones.
pycodestyle 2.0.0
-----------------
Announcements:
- Repository renamed to `pycodestyle`
- Added joint Code of Conduct as member of PyCQA
Changes:
- Added tox test support for Python 3.5 and pypy3
- Added check E275 for whitespace on `from ... import ...` lines
- Added W503 to the list of codes ignored by default ignore list
- Removed use of project level `.pep8` configuration file
Bugs:
- Fixed bug with treating `~` operator as binary
- Identify binary operators as unary
Other changes
-------------
- Unpin mccabe as the flake8 requirement got updated
- Pin pep8 as an older version gets installed otherwise
- DIsable D403 warning (false-positivies)
- Added ParserElement.split() generator method, similar to re.split().
Includes optional arguments maxsplit (to limit the number of splits),
and includeSeparators (to include the separating matched text in the
returned output, default=False).
- Added a new parse action construction helper tokenMap, which will
apply a function and optional arguments to each element in a
ParseResults. So this parse action:
def lowercase_all(tokens):
return [str(t).lower() for t in tokens]
OneOrMore(Word(alphas)).setParseAction(lowercase_all)
can now be written:
OneOrMore(Word(alphas)).setParseAction(tokenMap(str.lower))
Also simplifies writing conversion parse actions like:
integer = Word(nums).setParseAction(lambda t: int(t[0]))
to just:
integer = Word(nums).setParseAction(tokenMap(int))
If additional arguments are necessary, they can be included in the
call to tokenMap, as in:
hex_integer = Word(hexnums).setParseAction(tokenMap(int, 16))
- Added more expressions to pyparsing_common:
. IPv4 and IPv6 addresses (including long, short, and mixed forms
of IPv6)
. MAC address
. ISO8601 date and date time strings (with named fields for year, month, etc.)
. UUID (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)
. hex integer (returned as int)
. fraction (integer '/' integer, returned as float)
. mixed integer (integer '-' fraction, or just fraction, returned as float)
. stripHTMLTags (parse action to remove tags from HTML source)
. parse action helpers convertToDate and convertToDatetime to do custom parse
time conversions of parsed ISO8601 strings
- runTests now returns a two-tuple: success if all tests succeed,
and an output list of each test and its output lines.
- Added failureTests argument (default=False) to runTests, so that
tests can be run that are expected failures, and runTests' success
value will return True only if all tests *fail* as expected. Also,
parseAll now defaults to True.
- New example numerics.py, shows samples of parsing integer and real
numbers using locale-dependent formats:
4.294.967.295,000
4 294 967 295,000
4,294,967,295.000
pylint:
* config files with BOM markers can now be read.
* epylint.py_run does not crash on big files, using .communicate()
instead of .wait()
astroid:
* Fix a crash which occurred when the class of a namedtuple could not be
inferred.
* Functional form of enums support accessing values through __call__.
* Brain tips for the ssl library.
* Setuptools is now required to build CherryPy. Pure distutils installs
are no longer supported. This change allows CherryPy to depend on
other packages and re-use code from them. It's still possible to
install pre-built CherryPy packages (wheels) using pip without
Setuptools.
* Back out changes attempting to fix redirects with Unicode URLs, as it
also had the unintended consequence of causing the 'Location' to be
``bytes`` on Python 3.
* ``cherrypy.expose`` now works on classes.
* ``cherrypy.config`` decorator is now used throughout the code
internally.
* ``@cherrypy.expose`` now will also set the exposed
attribute on a class.
* Rewrote all tutorials and internal usage to prefer
the decorator usage of ``expose`` rather than setting
the attribute explicitly.
* Removed test-specific code from tutorials.
* Fix for filenames with semicolons and quote characters in filenames
found in headers.
* Added decorator for registering tools.
* Use simpler encoding rules for SCRIPT_NAME and PATH_INFO environment
variables in CherryPy Tree allowing non-latin characters to pass even
when ``wsgi.version`` is not ``u.0``.
* Ensure that multipart fields are decoded even when cached in a file.
- From this version onward, pytest-mock is licensed under the MIT
license.
- Now the plugin also adds introspection information on differing call
arguments when calling helper methods such as assert_called_once_with.
The extra introspection information is similar to pytest's and can be
disabled with the mock_traceback_monkeypatch option.
- mocker.stub() now allows passing in the name for the constructed Mock
object instead of having to set it using the internal _mock_name
attribute directly. This is useful for debugging as the name is used
in the mock's repr string as well as related assertion failure
messages.
- Monkey patching mock module for friendlier tracebacks is automatically
disabled with the --tb=native option. The underlying mechanism used to
suppress traceback entries from mock module does not work with that
option anyway plus it generates confusing messages on Python 3.5 due
to exception chaining.
- mock.call is now aliased as mocker.call for convenience.
* skip tests where one parameterize dimension was empty
* Fix Xfail does not work with condition keyword argument.
* Fix win32 path issue when puttinging 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.
* Fix ``pytest.mark.skip`` mark when used in strict mode.
* Minor improvements and fixes to the documentation.
* Fix ``--fixtures`` to show all fixture definitions as opposed to just
one per fixture name.
- Do not ignore imports which are present and have been added after the
minimum version
- Ignore imports which became mandatory with the minimum version
- Add two older future imports
- Issue an error when a future import does not exist
- Define which is the oldest Python version to be supported so that
already mandatory features can be ignored and not yet supported
features default to forbidden (ignoring the lower error code).
- Use return code of 1 if errors occurred
Otherwise the tests will fail with:
INVALID: process 975: D-Bus library appears to be incorrectly set up; failed to read machine uuid: UUID file '/etc/machine-id' should contain a hex string of length 32, not length 0, with no other text
INVALID: See the manual page for dbus-uuidgen to correct this issue.
While this makes things a little more complicated and means we'll need to use
`-r` to recreate tox environments, it has several advantages:
- Full support from requires.io (including PRs)
- Workaround for https://bitbucket.org/hpk42/tox/issues/332/ so we can update
virtualenv/pip
When we use qutebrowser.py, PyInstaller 3.2 gets confused
somehow (because of the name conflict with qutebrowser/ maybe?) and
doesn't do anything when running the bundled app.
With qutebrowser/__main__.py the generated filename is still correct and
it actually works.
Upstream Arch now updated to Qt 5.6 (which means it works with Xvfb), and using
debug packages means the image is a lot bigger and builds slower, so let's use
the normal packages from [extra].
Add a configurable userscript that fills login forms (i.e. the fiels
"Username" and "Password) of websites using a configurable backend where
the actual passwords are stored. The only backend yet is using the
password store "pass".
But only hide those tags that aren't children (or descendants) of other
tags that get replaced anyway. That is needed because sometimes, flash
videos are in <embed> tags, sometimgs in <object> tags and sometimes in
<embed> tags within <object> tags.
Furthermore enforce our "click here" link to have transparent background
(and in future: remove as many properties from website specific CSS
stylesheets).
This means: also replace <object> tags and put the replacement message
even higher in the z-order. (Latter had to be done to make it the
replacement visible on espn _dot_ com)