Commit Graph

528 Commits

Author SHA1 Message Date
Bruno Oliveira 240d314f36 copy test and changelog from #5607 by @niccodemus 2019-07-20 20:21:27 +02:00
Bruno Oliveira 65c23017c7 Update test_getfuncargnames_patching to work with modern mock 2019-07-15 12:23:59 -03:00
Bruno Oliveira 8a3f40996a Remove obsolete "importorskip('unittest.mock')" calls 2019-07-15 11:18:05 -03:00
Ran Benita 89dfde9535 Add rudimentary mypy type checking
Add a very lax mypy configuration, add it to tox -e linting, and
fix/ignore the few errors that come up. The idea is to get it running
before diving in too much.

This enables:

- Progressively adding type annotations and enabling more strict
  options, which will improve the codebase (IMO).

- Annotating the public API in-line, and eventually exposing it to
  library users who use type checkers (with a py.typed file).

Though, none of this is done yet.

Refs https://github.com/pytest-dev/pytest/issues/3342.
2019-07-09 12:12:07 -07:00
Anthony Sottile caa08ebd45 Improve quoting in raises match failure message 2019-07-04 05:55:26 -07:00
Bruno Oliveira 37fb50a3ed
Features assertion pass hook (#3479)
Features assertion pass hook
2019-06-26 21:14:19 -03:00
Victor Maryama 6f851e6cbb Merge remote-tracking branch 'upstream/master' into features-assertion-pass-hook-master
# Conflicts:
#	src/_pytest/assertion/rewrite.py
2019-06-26 18:12:56 +02:00
Zac Hatfield-Dodds ed85c83154 Deprecate funcargnames alias 2019-06-26 08:53:17 +10:00
Kevin J. Foley 95714436a1 Pickup additional positional args passed to _parse_parametrize_args 2019-06-24 20:43:52 -04:00
Victor Maryama 9a89783fbb Assertion passed hook 2019-06-24 16:09:39 +02:00
Bruno Oliveira 689ce112e7
Small cleanups on _pytest.compat (#5451)
Small cleanups on _pytest.compat
2019-06-16 10:42:07 -03:00
Bruno Oliveira 177af032d2 Remove unused/unneeded code 2019-06-15 10:45:16 -03:00
Ronny Pfannschmidt 2b92fee1c3 initial conversion of exit codes to enum 2019-06-15 06:48:00 +02:00
Anthony Sottile ccd87f9e80 small mypy fixes 2019-06-06 09:13:02 -07: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 5dcf85c17e manual: remove dependence on six 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 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
Victor Maryama 65bd1b8a93 Avoiding looking upwards for parameter argnames when generating fixtureinfo. 2019-05-30 23:42:04 +02:00
Bruno Oliveira 5cbc06a453 Show test module in the PytestCollectionWarning message
Related to #5330
2019-05-30 08:18:28 -03:00
Bruno Oliveira 66f20b6f5e
Fix invalid Python file encoding "utf8" (#5252)
Fix invalid Python file encoding "utf8"
2019-05-23 20:24:23 -03:00
Akiomi Kamakura 8a498700da Add tests for #5286 2019-05-22 03:56:52 +09: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 f1183c2422 Remove the 'issue' marker from test suite
It doesn't seem to add much value (why would one execute tests
based on that marker?), plus using the docstring for that
encourages one to write a more descriptive message about the test
2019-05-09 19:36:38 -03:00
Bruno Oliveira 6d040370ed Show fixture scopes with ``--fixtures``, except for "function" scope
Fix #5220
2019-05-07 14:32:20 -03:00
Daniel Hahler 6f0a5789fb Merge master into features 2019-04-14 23:22:21 +02:00
Anthony Sottile da2e092163 pre-commit autoupdate 2019-04-12 04:52:47 -07:00
Zac-HD 00810b9b2a Register "issue" mark for self-tests 2019-03-31 14:22:30 +11:00
Daniel Hahler e1ae469504 Merge master into features 2019-03-26 10:23:21 +01:00
Daniel Hahler 58a14b6b99
Merge pull request #4986 from blueyed/fnmatch_lines-list
tests: fnmatch_lines: use list
2019-03-25 23:31:04 +01:00
Daniel Hahler 3127ec737b Fix pytest's own tests with `-W error::ResourceWarning` 2019-03-24 11:05:00 +01:00
Daniel Hahler 08f3b02dfc tests: fnmatch_lines: use list
For strings fnmatch_lines converts it into a Source objects, splitted on
newlines.  This is not necessary here, and it is more consistent to use
lists here in the first place.
2019-03-23 11:36:18 +01:00
Daniel Hahler 05d55b86df tests: minor sys.path cleanup 2019-03-22 16:20:55 +01:00
Daniel Hahler d441fa66fe Fix line offsets with `ScopeMismatch` errors
Fixes https://github.com/pytest-dev/pytest/issues/4928.
2019-03-15 02:47:33 +01:00
Daniel Hahler c334adc78f
Apply suggestions from code review
Co-Authored-By: nicoddemus <nicoddemus@gmail.com>
2019-03-03 11:20:00 -03:00
Bruno Oliveira 6a2d122a50 Remove code debugging leftovers 2019-03-02 09:56:15 -03:00
Bruno Oliveira d97473e551 Add test and CHANGELOG for #1895 2019-03-02 09:39:30 -03:00
Bruno Oliveira 525639eaa0 Rename fixtures testing file to be consistent with the module name 2019-03-02 09:37:30 -03:00
Bruno Oliveira 7dceabfcb2 Ensure fixtures obtained with getfixturevalue() are finalized in the correct order
Fix #1895
2019-03-02 09:36:16 -03:00
Anthony Sottile 4c7ddb8d9b Fix `parametrize(... ids=<function>)` when the function returns non-strings. 2019-02-07 12:25:59 -08:00
Anthony Sottile 2264db7f4a
Merge pull request #4682 from arel/parameterize-conditional-raises-document-only
Document parametrizing conditional raises
2019-02-02 13:15:26 -08:00
Bruno Oliveira ade5f2c8c5 Merge remote-tracking branch 'upstream/master' into merge-master-into-features 2019-01-29 19:36:56 -02:00
Arel Cordero fd4289dae0 Adding `does_not_raise` to documentation only 2019-01-27 16:42:10 +00:00
Arel Cordero 977adf1354 Improving sphinx docs based on feedback 2019-01-27 16:41:23 +00:00
Arel Cordero afe9fd5ffd Adds `does_not_raise` context manager
Addressing issues #4324 and #1830
2019-01-27 16:40:35 +00:00
Ronny Pfannschmidt 5567c772cd quick&dirty fix fixture tests that rely on tmppath fixture structure 2019-01-27 14:19:23 +01:00