Commit Graph

3223 Commits

Author SHA1 Message Date
Bruno Oliveira 2d613a03b3
Async result warn (#5742)
Async result warn
2019-08-15 09:47:56 -03:00
Bruno Oliveira 28c6c5bb71
check that tests that are partial staticmethods are supported (#5701)
check that tests that are partial staticmethods are supported
2019-08-15 09:12:01 -03:00
Thomas Grainger 6b9d729ed3
also warn on awaitable or async iterable test results 2019-08-15 12:30:44 +01:00
Bruno Oliveira 0ba774a7c3
warn for async generator functions (#5734)
warn for async generator functions
2019-08-15 08:17:12 -03:00
Thomas Grainger 137255816e Fix collection of staticmethods defined with functools.partial
Related to #5701
2019-08-15 08:04:05 -03:00
Thomas Grainger 2f1b192fe6 Issue a warning for async gen functions
Co-Authored-By: Bruno Oliveira <nicoddemus@gmail.com>
2019-08-15 07:54:10 -03:00
dmitry.dygalo 7183335e62 Capture warnings during ``pytest_configure``
Fix #5115
2019-08-15 07:50:27 -03:00
Daniel Hahler 0db9dade65 test_non_ascii_paste_text: mock call to urlopen
Likely to fix flaky coverage due to requests failing sometimes.
Ref: f7e81dab9a...83a1f4bd66/changes
2019-08-10 23:30:49 +02:00
Thomas Grainger ef0915e1db
fix grammar in test_collect_functools_partial docstr 2019-08-06 15:27:36 +01:00
Daniel Hahler 198fcd8a6f Fix RuntimeError when trying to collect package with "__init__.py" only
Fixes https://github.com/pytest-dev/pytest/issues/4344.
2019-08-05 17:52:21 +02:00
Anthony Sottile 82763a293a
Merge pull request #5684 from nicoddemus/errno-nomore
Use OSError subclasses instead of handling errno
2019-08-04 14:50:12 -07:00
Bruno Oliveira d3e1907899 Use OSError subclasses instead of handling errno 2019-08-02 14:17:46 -03:00
Daniel Hahler 9064eea216 Improve rm_rf to handle only known functions
Warnings are emitted if we cannot safely remove
paths.

Fix #5626
2019-08-02 08:18:11 -03:00
Anthony Sottile 1076a7e61d
Merge pull request #5680 from ss18/ss18/pr0
Fix some typos
2019-08-01 08:18:48 -07:00
Semen Zhydenko d19fe3c410 didnt -> didn't 2019-08-01 15:10:39 +02:00
Semen Zhydenko 2de145f372 wasnt -> wasn't 2019-08-01 15:10:06 +02:00
Semen Zhydenko 942fd91995 shouldnt -> shouldn't 2019-08-01 15:09:14 +02:00
Kaiqi aa13c625da Change the warning message 2019-07-27 21:06:29 +02:00
Miro Hrončok ab39502c98 In test_xfail_handling, only remove __pycache__ if it exists
Previously, the test failed when the directory was not present,
which could have been caused for example by invoking the tests
with PYTHONDONTWRITEBYTECODE=1.

Fixes https://github.com/pytest-dev/pytest/issues/5664
2019-07-26 02:23:14 +02:00
Daniel Hahler 401c3d1109 tests: unittest: fix/harden "test_exit_outcome"
Ref: https://github.com/pytest-dev/pytest/pull/5634#pullrequestreview-265565917
2019-07-23 19:35:51 +02:00
Bruno Oliveira a82dd2f064 Fix linting 2019-07-23 10:55:22 -03:00
Florian Bruhin 8c47db724c Improve output when parsing an ini configuration fails 2019-07-23 15:27:27 +02:00
Bruno Oliveira 693e9d0733
Merge pull request #5634 from blueyed/fix-unittest-exit
unittest: handle outcomes.Exit
2019-07-23 10:08:43 -03:00
Bruno Oliveira 0824789459 Improve test for pytest.exit handling 2019-07-23 08:53:38 -03:00
Bruno Oliveira ec4ca59bf0
Merge pull request #5631 from RonnyPfannschmidt/fix-5606
use identity checks for the mock sentinels
2019-07-23 08:48:58 -03:00
Bruno Oliveira 240d314f36 copy test and changelog from #5607 by @niccodemus 2019-07-20 20:21:27 +02:00
Anthony Sottile 27c9d80a7e Fix ordering of sys modules snapshot 2019-07-20 11:17:30 -07:00
Daniel Hahler d35d09f82d unittest: handle outcomes.Exit
This is required for pytest to stop when using "quit" in pdb, and should
get honored/handled in general.
2019-07-20 07:11:49 +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
Bruno Oliveira 37c37963c4 Fix rmtree to remove directories with read-only files
Fix #5524
2019-07-11 18:24:53 -03:00
Bruno Oliveira 2c402f4bd9
[cherry-pick to master] Add rudimentary mypy type checking (#5583)
[cherry-pick to master] Add rudimentary mypy type checking
2019-07-10 07:52:32 -03:00
Bruno Oliveira 57e5bd0664
Improve type-checking in OutcomeException (#5580)
Improve type-checking in OutcomeException
2019-07-09 19:12:05 -03:00
Bruno Oliveira 9db1823707 Improve type-checking in OutcomeException
Fix #5578
2019-07-09 18:26:57 -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
Bruno Oliveira f1b8431d99 Sort parametrize params to test_external_plugins_integrated
This might cause problems during collection with pytest-xdist; we
didn't see any so far mostly by luck I think.

Shame on me for letting that slip in.
2019-07-05 19:05:55 -03:00
Bruno Oliveira 8651d880a0 Handle xfail(strict=True) properly in --step-wise mode
Fix #5547
2019-07-04 20:28:37 -03:00
Anthony Sottile caa08ebd45 Improve quoting in raises match failure message 2019-07-04 05:55:26 -07:00
Anthony Sottile 7ee244476a Remove astor and reproduce the original assertion expression 2019-06-28 13:38:52 -07:00
Anthony Sottile 4e723d6750 Fix crash when discovery fails while using `-p no:terminal` 2019-06-27 10:24:29 -07:00
Anthony Sottile 3e0e31a364 Don't crash with --pyargs and a filename that looks like a module 2019-06-27 08:32:32 -07:00
Bruno Oliveira 37fb50a3ed
Features assertion pass hook (#3479)
Features assertion pass hook
2019-06-26 21:14:19 -03:00
Bruno Oliveira 790806e865
Merge pull request #5494 from Zac-HD/funcargnames-to-fixturenames
Deprecate funcargnames alias for fixturenames
2019-06-26 21:13:59 -03:00
Bruno Oliveira 2ea22218ff Cover assertions with messages when enable_assertion_pass_hook is enabled 2019-06-26 20:46:31 -03:00
Bruno Oliveira eb90f3d1c8 Fix default value of 'enable_assertion_pass_hook' 2019-06-26 17:54:24 -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
Victor Maryama f755ff6af1 Black formatting. 2019-06-26 18:10:16 +02:00
Victor Maryama d638da5821 Using ini-file option instead of cmd option. 2019-06-26 18:10:16 +02:00
Anthony Sottile 3f3f3e7a29
Merge pull request #5495 from nicoddemus/blueyed/cmp-bytes
Improve comparison of byte strings (supersedes #5267)
2019-06-25 19:16:24 -07:00
Bruno Oliveira 3f2344e8f7 Show bytes ascii representation instead of numeric value 2019-06-25 20:40:25 -03:00