Anthony Sottile
33d119f71a
py36+: com2ann
2020-10-05 18:33:17 -07:00
Anthony Sottile
66bd44c13a
py36+: pyupgrade: py36+
2020-10-03 12:46:54 -07:00
Bruno Oliveira
19e99ab413
Integrate warnings filtering directly into Config ( #7700 )
...
Warnings are a central part of Python, so much that Python itself has
command-line and environtment variables to handle warnings.
By moving the concept of warning handling into Config, it becomes natural to
filter warnings issued as early as possible, even before the "_pytest.warnings"
plugin is given a chance to spring into action. This also avoids the weird
coupling between config and the warnings plugin that was required before.
Fix #6681
Fix #2891
Fix #7620
Fix #7626
Close #7649
Co-authored-by: Ran Benita <ran@unusedvar.com>
2020-09-04 11:57:15 -03:00
Bruno Oliveira
372a094005
PytestDeprecationWarning no longer a hard error
2020-08-19 08:14:28 -03:00
Bruno Oliveira
ef946d557c
Remove resultlog plugin
2020-08-19 08:14:28 -03:00
Ran Benita
b8471aa527
testing: fix some docstring issues
...
In preparation for enforcing some docstring lints.
2020-08-03 10:10:43 +03:00
Bruno Oliveira
7ec6401ffa
Change pytest deprecation warnings into errors for 6.0 release ( #7362 )
...
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2020-07-22 21:36:51 -03:00
Ran Benita
54ad048be7
Enable check_untyped_defs mypy option for testing/ too
2020-06-05 11:34:20 +03:00
Gleb Nikonorov
2af0d1e221
remove a stray comma in a test tuple
2020-05-28 00:02:28 -04:00
Gleb Nikonorov
14de08011b
fix the unit tests, add the proper deprecation warning, and add in a changelog entry
2020-05-27 23:03:07 -04:00
Gleb Nikonorov
d742b386c3
provide missing location parameter, and add type annotations to the hookspec
2020-05-27 00:53:31 -04:00
Gleb Nikonorov
088d400b2d
rename pytest_warning_record -> pytest_warning_recorded
2020-05-24 20:43:23 -04:00
Gleb Nikonorov
9ee6550181
Add in a new hook pytest_warning_recorded for warning capture
...
communication
2020-05-24 19:05:24 -04:00
Daniel Hahler
8cae78a18b
Fix warnings summary
...
- replace "tests with warnings" with just warnings: they a) might not
come from a test in the first place, and b) a single test might have
multiple warnings.
- fix usage of (unused) argument to `collapsed_location_report`
Co-authored-by: Ran Benita <ran@unusedvar.com>
2020-05-05 21:40:34 +03:00
Bruno Oliveira
a016a75ca7
Fix linting
2020-03-27 09:54:20 -03:00
Daniel Hahler
e651562271
test_warnings: clean up usage of pyfile_with_warnings ( #6799 )
...
Remove it where not used / overwritten, and use its reference otherwise,
which makes it clear that it is used actually.
2020-03-27 02:24:00 +01:00
Ronny Pfannschmidt
23c43a37e0
summarize warning summaries if the number of locations is high
2020-03-01 14:08:15 +01:00
Daniel Hahler
2b5adc88a7
Move test_issue4445_cacheprovider_set into test_cache_failure_warns
...
Would need to be adjusted anyway non-trivially, and we can just harden
`test_cache_failure_warns` instead.
2020-02-15 02:01:22 +01:00
Daniel Hahler
75714ee707
pluginmanager.consider_preparse: add exclude_only kwarg ( #6443 )
...
Plugins specified with ``-p`` are now loaded after internal plugins, which
results in their hooks being called *before* the internal ones.
This makes the ``-p`` behavior consistent with ``PYTEST_PLUGINS``.
* fix/adjust test_disable_plugin_autoload
* adjust test_plugin_loading_order
2020-02-03 14:10:54 +01:00
Bruno Oliveira
59f95b7f59
Merge remote-tracking branch 'upstream/master' into mm
2019-12-03 11:07:34 -03:00
Philipp Loose
a02310a140
Add stacklevel tests for warnings, 'location' to pytest_warning_captured
...
Resolves #4445 and #5928 (thanks to allanlewis)
Add CHANGELOG for location parameter
2019-11-22 17:50:00 -03:00
Anthony Sottile
faea273c93
Revert "A warning is now issued when assertions are made for `None`"
2019-11-19 08:24:08 -08:00
Daniel Hahler
68dbc24dcb
test_group_warnings_by_message: ignore own PytestExperimentalApiWarning
2019-11-03 21:14:24 +01:00
MarcoGorelli
d863c30c74
Fix plurality mismatch for and in pytest terminal summary
2019-10-27 15:16:24 +00:00
Bruno Oliveira
d7f082519a
Merge remote-tracking branch 'upstream/master' into mm
...
Conflicts:
src/_pytest/outcomes.py
2019-08-15 10:03:52 -03:00
dmitry.dygalo
7183335e62
Capture warnings during ``pytest_configure``
...
Fix #5115
2019-08-15 07:50:27 -03:00
Bruno Oliveira
c470ade0a5
Remove 'RemovedInPytest4Warning'
2019-06-30 13:31:39 -03:00
Bruno Oliveira
8f5cb461a8
Turn PytestDeprecationWarning into error
...
Fix #5402
2019-06-05 19:02:52 -03:00
Anthony Sottile
be2be040f9
Clean up u' prefixes and py2 bytes conversions
2019-06-04 17:50:34 -07:00
Anthony Sottile
96fd44e040
Update line number for warning
2019-06-03 12:08:02 -03:00
Anthony Sottile
4df529e5b9
Clean up __future__ and coding: in tests
2019-06-03 12:08:02 -03:00
Anthony Sottile
a91fe1fedd
pre-commit run pyupgrade --all-files
2019-06-03 12:08:02 -03:00
Anthony Sottile
3f1ec520fc
pre-commit run reorder-python-imports --all-files
2019-06-03 12:08:01 -03:00
Anthony Sottile
5034399d7a
pre-commit run fix-encoding-pragma --all-files
2019-06-03 12:08:01 -03:00
Bruno Oliveira
4d49ba6529
Drop Python 2.7 and 3.4 support
...
* Update setup.py requires and classifiers
* Drop Python 2.7 and 3.4 from CI
* Update docs dropping 2.7 and 3.4 support
* Fix mock imports and remove tests related to pypi's mock module
* Add py27 and 34 support docs to the sidebar
* Remove usage of six from tmpdir
* Remove six.PY* code blocks
* Remove sys.version_info related code
* Cleanup compat
* Remove obsolete safe_str
* Remove obsolete __unicode__ methods
* Remove compat.PY35 and compat.PY36: not really needed anymore
* Remove unused UNICODE_TYPES
* Remove Jython specific code
* Remove some Python 2 references from docs
Related to #5275
2019-06-02 14:39:11 -03:00
Anthony Sottile
dc75b6af47
Use fix-encoding-pragma pre-commit hook
2019-05-14 15:56:31 -07:00
Bruno Oliveira
7573747cda
Normalize all source encoding declarations
2019-05-14 19:42:44 -03:00
Bruno Oliveira
685ca96c71
Change ``--strict`` to ``--strict-markers``, preserving the old one
...
Fix #5023
2019-05-09 19:36:38 -03:00
Bruno Oliveira
53cd7fd2ea
Introduce new warning subclasses
...
Fix #5177
2019-04-28 10:38:25 -03:00
Daniel Hahler
0ea1889265
test_as_errors: use subprocess with `-W`
...
Ref: https://github.com/pytest-dev/pytest/pull/4981
2019-03-24 11:17:55 +01:00
Daniel Hahler
0d31e852b1
Run isort
2019-03-01 14:24:18 +01:00
Bruno Oliveira
9543d1901f
Group warnings by message instead of by test id
2019-01-22 19:42:22 -02:00
Bruno Oliveira
e4a21b11d5
Change test_warningschecker_twice to a unittest
2019-01-09 18:58:51 -02:00
Victor Maryama
948a5d5ac6
Added test for Issue 4617
2019-01-09 12:31:26 +01:00
Bruno Oliveira
fd48cd57f9
Remove config.warn, Node.warn; pytest_logwarning issues a warning when implemented
...
Fix #3078
2018-12-14 12:50:18 -02:00
Daniel Hahler
5ebacc49c6
Harden tests, fix doc/msg
2018-12-05 19:22:44 +01:00
Tomer Keren
e1e4b226c6
👌 Address code review
...
Edited the changelog for extra clarity, and to fire off auto-formatting
Oddly enough, keeping `filename='{filename!r}'` caused an error while
collecting tests, but getting rid of the single ticks fixed it
Hopefully closes #3191
2018-12-05 10:52:12 +02:00
Tomer Keren
e0c2ab1901
Fix tests not to assert a function that already asserts
...
Maybe there should be a warning about that too?
2018-12-05 10:41:30 +02:00
Tomer Keren
9fc9b2926f
Fix tests and add aditional cases
...
As requested by review.
👌 Address code review for tests
2018-12-05 10:41:30 +02:00
Tomer Keren
1654b77ca0
[ #3191 ] Set up tests to confirm warnings
2018-12-05 10:41:18 +02:00