forked from pytest-dev/pytest
-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TEST: merge (#142) + revert (#143) #179
Open
blueyed
wants to merge
210
commits into
my-master
Choose a base branch
from
test-revert
base: my-master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fixes pytest-dev#5991 Fixes pytest-dev#3823 Ref: pytest-dev/pytest-django#772 Ref: pytest-dev#1890 Ref: pytest-dev/pytest-django#782 - inject wrapped testMethod - adjust test_trial_error - add test for `--trace` with unittests
- Isolate logic for getting expected exceptions - Use original method name, as users see it when entering the debugger
Otherwise 'normal' failures won't call teardown explicitly
rename test_pdb to test_debugging
Update mypy 0.740 -> 0.750
unittest: do not use TestCase.debug() with `--pdb`
Merge master into features
Co-Authored-By: Bruno Oliveira <nicoddemus@gmail.com>
Conflicts: src/_pytest/unittest.py testing/test_unittest.py
Co-Authored-By: Bruno Oliveira <nicoddemus@gmail.com>
As discussed, sometimes we will need to introduce changes which are not necessarily removals but might break existing suites
Co-Authored-By: Anthony Sottile <asottile@umich.edu> Co-Authored-By: Bruno Oliveira <nicoddemus@gmail.com> Co-Authored-By: Hugo van Kemenade <hugovk@users.noreply.github.com>
…-breakage Deprecation policy - insert considerations for breaking changes
pytest-dev#4597: tee-stdio capture method
An improvement seems more adequate here.
Change 4639 from feature to improvement
…-matching-case-insensitive Make keyword expression matching case-insensitive
As far as the output is concerned, they are both identical so it doesn't make sense to have both. setup, teardown, and collect failures are already reported as "errors", "E".
Allows for filtering of PytestCacheWarning. Using `_issue_warning_captured` is not necessary here, and was probably only used because the cacheprovider misses warnings during `pytest_sessionfinish`, which is also fixed here. I think the usage of `_issue_warning_captured` can be removed/reduced further, but also that this is good enough for now. Ref: pytest-dev#6681.
Would need to be adjusted anyway non-trivially, and we can just harden `test_cache_failure_warns` instead.
Using getattr doesn't work with typing, and also breaks grep. It took me a while to find where these hooks are called.
Every Item must implement this method (called on all items collected in a session). Add a stub for typing and clarity.
Avoid getattr when dispatching pytest_runtest_* hooks
Conflicts: src/_pytest/terminal.py testing/test_debugging.py testing/test_terminal.py
Add Item.runtest stub implementation
Type annotate Metafunc
Mypy currently is unable to handle assigning attributes on function: python/mypy#2087. pytest uses this for the outcome exceptions -- `pytest.fail.Exception`, `pytest.exit.Exception` etc, and this is the canonical name by which they are referred. Initially we started working around this with type: ignores, and later by switching e.g. `pytest.fail.Exception` with the direct exception `Failed`. But this causes a lot of churn and is not as nice. And I also found that some code relies on it, in skipping.py: def pytest_configure(config): if config.option.runxfail: # yay a hack import pytest old = pytest.xfail config._cleanup.append(lambda: setattr(pytest, "xfail", old)) def nop(*args, **kwargs): pass nop.Exception = xfail.Exception setattr(pytest, "xfail", nop) ... So it seems better to support it. Use a hack to make it work. The rest of the commit rolls back all of the workarounds we added up to now. `pytest.raises.Exception` also exists, but it's not used much so I kept it as-is for now. Hopefully in the future mypy supports this and this ugliness can be removed.
Fixes using `pytest.xfail()` and `pytest.importorskip()` in doctests. Ref: pytest-dev#310
) Fix pytest-dev#6289 Co-authored-by: Ran Benita <ran234@gmail.com>
…llable-2 Use a hack to make typing of pytest.fail.Exception & co work
) Fixes pytest-dev#5301. Refactor/steps: - use var - harden test_lastfailed_usecase - harden test_failedfirst_order - revisit last_failed_paths - harden test_lastfailed_with_known_failures_not_being_selected
Conflicts: src/_pytest/assertion/util.py src/_pytest/main.py testing/test_assertion.py testing/test_terminal.py
Conflicts: src/_pytest/_code/code.py src/_pytest/doctest.py src/_pytest/nodes.py src/_pytest/terminal.py testing/python/metafunc.py testing/test_assertion.py testing/test_cacheprovider.py testing/test_warnings.py
Conflicts: src/_pytest/cacheprovider.py
Keep `NodeMeta._create` for compatibility. Conflicts: testing/python/metafunc.py
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ref: #142
Ref: #143
Ref: pytest-dev#6645
NOTE: only for testing, needs to be rebased/cleaned up.