summaryrefslogtreecommitdiff
path: root/_pytest/assertion
AgeCommit message (Collapse)Author
2017-07-17Fixed E731 flake8 errorsAndras Tim
do not assign a lambda expression, use a def
2017-07-17Fixed E303 flake8 errorsAndras Tim
too many blank lines (3)
2017-07-17Fixed E302 flake8 errorsAndras Tim
expected 2 blank lines, found 0
2017-07-17Fixed E261 flake8 errorsAndras Tim
at least two spaces before inline comment
2017-07-17Fixed E231 flake8 errorsAndras Tim
missing whitespace after ‘,’, ‘;’, or ‘:’
2017-07-17Fixed E226 flake8 errorsAndras Tim
missing whitespace around arithmetic operator
2017-07-17Fixed E225 flake8 errorsAndras Tim
missing whitespace around operator
2017-07-17Fixed E129 flake8 errorsAndras Tim
visually indented line with same indent as next logical line
2017-07-17Fixed E127 flake8 errorsAndras Tim
continuation line over-indented for visual indent
2017-06-13Remove obsolete comment from rewrite.pyBruno Oliveira
This was made obsolete by 021e843427c6f5e79ee4a5b47ef3015599292822
2017-05-31Fixed #2121 Use `py.path`s fnmatch. This fixes an issue whereAndreas Pelme
python_files handled properly when rewriting assertions.
2017-05-17Revert refactor of old-style to new-style classesBruno Oliveira
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.
2017-04-21Merge pull request #2315 from RonnyPfannschmidt/namespace-hookBruno Oliveira
remove pytest internal usage of the namespace hook
2017-04-06Ensure rewritten modules don't inherit __future__ flags from pytestBruno Oliveira
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().
2017-03-28remove pytest_namespace from _pytest/assertionRonny Pfannschmidt
2017-03-16Add __future__ imports to all pytest modulesBruno Oliveira
This prevents silly errors from creeping in Python 2 when testing in Python 3
2017-03-10Merge remote-tracking branch 'upstream/master' into merge-master-into-featuresBruno Oliveira
# Conflicts: # AUTHORS # CHANGELOG.rst # _pytest/pytester.py
2017-02-14Safer sys.modules deletePatrick Hayes
2017-01-08Refactored old style classes to new style classesmandeep
2016-12-27Merge branch 'master' into merge-master-into-featuresBruno Oliveira
2016-12-02Fix typo in docstring of register_assert_rewriteBruno Oliveira
2016-12-01Fix false-positive assert rewrite warnings when using 'pytest_plugins'Bruno Oliveira
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
2016-11-27Merge branch 'master' into merge-master-into-featuresBruno Oliveira
2016-11-22Merge pull request #2070 from nedbat/bug2038Ronny Pfannschmidt
Don't fail if imp can't find the source for a .pyc file. #2038
2016-11-22Merge pull request #2075 from pytest-dev/masterBruno Oliveira
Merge master into features after fixing flake8 errors
2016-11-20Fix flake8 E305 and E306 errorsBruno Oliveira
These errors started to appear with flake8-3.1.1, while they don't appear with version 3.1.0 (weird).
2016-11-20Don't fail if imp can't find the source for a .pyc file. #2038Ned Batchelder
2016-11-13Merge pull request #1995 from mattduck/feat/restructure-assert-truncationBruno Oliveira
Restructure truncation of assertion messages
2016-11-11Merge branch 'master' into merge-master-featuresBruno Oliveira
2016-10-20Fix false-positive warnings from assertion rewrite hookBruno Oliveira
Fix #2005
2016-10-11Fix flake8 (unused import, trailng whitespace)Matthew Duck
2016-10-10Restructure truncation of assertion messagesMatthew Duck
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.
2016-09-26Merge remote-tracking branch 'upstream/master' into featuresBruno Oliveira
2016-09-21Fix `DeprecationWarnings` found when running py.test in Python 2.7 with the ↵Roy Williams
-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.
2016-09-19Tidy formatting of assertion truncationMatthew Duck
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.
2016-09-19Don't display dict common items if verbosity=1Matthew Duck
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.
2016-09-05Merge pull request #1913 from flub/builtin-assertionRonny Pfannschmidt
Remove BuiltinAssertionError
2016-09-05Remove BuiltinAssertionErrorFloris Bruynooghe
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.
2016-08-30Fix issue where pytest_plugins as string was marking wrong modules for rewriteBruno Oliveira
Fix #1888
2016-08-03Rewrite asserts in test-modules loaded very early in the startupBruno Oliveira
Also now match modules which start with any of the names registered using register_assert_rewrite as discussed in #1787 Fix #1784
2016-07-15Remove assertion reinterpretationFloris Bruynooghe
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.
2016-07-14Fixup things after rebaseFloris Bruynooghe
Some changes to make things work on top of current features branch.
2016-07-13Introduce pytest.register_assert_rewrite()Floris Bruynooghe
Plugins can now explicitly mark modules to be re-written. By default only the modules containing the plugin entrypoint are re-written.
2016-07-13Avoid rewrite warning for inline runsFloris Bruynooghe
When running pytest inline/inprocess we plugins have already been imported and re-writen, so avoid the warning.
2016-07-13Enable re-writing of setuptools-installed pluginsFloris Bruynooghe
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.
2016-07-11Replace all usages of "pytest_funcarg__" for @pytest.fixtureBruno Oliveira
2016-07-06merge from master to featuresRonny Pfannschmidt
2016-06-26Remove commented out codeBruno Oliveira
2016-06-26Merge pull request #1675 from kvas-it/issue-1562Bruno Oliveira
Add warning for assertions on tuples #1562
2016-06-26Remove deprecated cmd optionsRedBeardCode
Fixes #1657