Age | Commit message (Collapse) | Author |
|
do not assign a lambda expression, use a def
|
|
too many blank lines (3)
|
|
expected 2 blank lines, found 0
|
|
at least two spaces before inline comment
|
|
missing whitespace after ‘,’, ‘;’, or ‘:’
|
|
missing whitespace around arithmetic operator
|
|
missing whitespace around operator
|
|
visually indented line with same indent as next logical line
|
|
continuation line over-indented for visual indent
|
|
This was made obsolete by 021e843427c6f5e79ee4a5b47ef3015599292822
|
|
python_files handled properly when rewriting assertions.
|
|
As discussed in the mailing list, unfortunately this might break APIs
due to the subtle differences between new and old-style classes (see #2398).
This reverts commit d4afa1554b225d11565d5fb81136edea51c54b0d from PR #2179.
|
|
remove pytest internal usage of the namespace hook
|
|
In a recent refactoring we enabled all __future__ features in pytest
modules, but that has the unwanted side effect of propagating those
features to compile()'d modules inside assertion rewriting, unless
we pass dont_inherit=False to compile().
|
|
|
|
This prevents silly errors from creeping in Python 2 when testing in Python 3
|
|
# Conflicts:
# AUTHORS
# CHANGELOG.rst
# _pytest/pytester.py
|
|
|
|
|
|
|
|
|
|
pytest would emit false positive warnings about assertion-rewrite when a
module appears multiple times in plugins which depend
on other plugins using the 'pytest_plugins' mechanism
|
|
|
|
Don't fail if imp can't find the source for a .pyc file. #2038
|
|
Merge master into features after fixing flake8 errors
|
|
These errors started to appear with flake8-3.1.1, while they don't appear with
version 3.1.0 (weird).
|
|
|
|
Restructure truncation of assertion messages
|
|
|
|
Fix #2005
|
|
|
|
This addresses ref https://github.com/pytest-dev/pytest/issues/1954.
The current truncation for assertion explanations does not deal with long lines
properly:
- Previously if lines were too long it would display a "-n more lines"
message.
- 999e7c65417f1e97fc89bf66e0da4c5cd84442ec introduced a bug where long lines can
cause index errors if there are < 10 lines.
Extract the truncation logic into its own file and ensure it can deal with
long lines properly.
|
|
|
|
-3 flag.
Running through some of my tests with the `-3` flag in python2.7 I encountered some errors within py.test itself. This fixes those errors so we can use py.test in order to identify problems with Python 3.
|
|
Part two of https://github.com/pytest-dev/pytest/issues/1512. Update the format
of the truncation message to help make it clear that pytest truncates the
entire assertion output when verbosity < 2.
|
|
Part one of https://github.com/pytest-dev/pytest/issues/1512.
If verbosity=1, assertion explanations are truncated at 10 lines. In this
situation, it's more important to tell the user which dictionary items are
different than which are the same.
|
|
Remove BuiltinAssertionError
|
|
We used to have this when we where patching the real Python
AssertionError for use with reinterpret, but reinterpret is now
gone so we no longer need this as it is not used by rewrite.
|
|
Fix #1888
|
|
Also now match modules which start with any of the names registered
using register_assert_rewrite as discussed in #1787
Fix #1784
|
|
The assertion reinterpretation is an old backwards compatibility
mode which was no longer being maintained on feature-parity with
the assertion rewriting mode. It was also responsible for some
dubious patching of builtins and test with side-effects would
suddenly start passing. Since re-writing has been the default for
a long time and plugins are now also re-written it is time to
retire reinterpretation.
|
|
Some changes to make things work on top of current features branch.
|
|
Plugins can now explicitly mark modules to be re-written. By default
only the modules containing the plugin entrypoint are re-written.
|
|
When running pytest inline/inprocess we plugins have already been
imported and re-writen, so avoid the warning.
|
|
Hook up the PEP 302 import hook very early in pytest startup so
that it gets installed before setuptools-installed plugins are
imported. Also iterate over all installed plugins and mark them
for rewriting. If an installed plugin is already imported then
a warning is issued, we can not break since that might break
existing plugins and the fallback will still be gracefull to
plain asserts.
Some existing tests are failing in this commit because of the new
warning triggered by inline pytest runs due to the hypothesis
plugin already being imported. The tests will be fixed in the next
commit.
|
|
|
|
|
|
|
|
Add warning for assertions on tuples #1562
|
|
Fixes #1657
|