Commit Graph

444 Commits

Author SHA1 Message Date
Bruno Oliveira dc20dedbc7 Change RemovedInPytest4Warnings to errors by default
To keep existing tests which emit RemovedInPytest4Warnings running, decided
to go with a command line option because:

* Is harder to integrate an ini option with tests which already use an ini file
* It also marks tests which need to be removed/updated in 4.1, when
  RemovedInPytest4Warning and related functionality are removed.

Fix #3737
2018-11-12 16:10:57 -02:00
Daniel Hahler f551cb9677 Skip Instances with --collect-only 2018-11-10 23:48:02 +01:00
Daniel Hahler e30f7094f3 python: collect: ignore exceptions with isinstance
Fixes https://github.com/pytest-dev/pytest/issues/4266.
2018-11-01 22:14:13 +01:00
Anthony Sottile 2368fbb63c Apply reorder-python-imports to all files 2018-10-25 00:01:29 -07:00
Bruno Oliveira 02ae7d8531 Improve error message when a recursive dependency between fixtures is detected
Fix #2909
2018-10-20 09:44:42 -03:00
Bruno Oliveira 9646a1cd7a Merge remote-tracking branch 'upstream/master' into merge-master-into-features 2018-10-15 12:55:28 -03:00
Bruno Oliveira 4808145846 test_request_garbage is flaky when running with xdist
Example failure:

https://travis-ci.org/pytest-dev/pytest/jobs/441305926#L545
2018-10-14 15:17:08 -03:00
Bruno Oliveira 933de16fe4
Merge pull request #3988 from RonnyPfannschmidt/tmpdir-port-pathlib
Tmpdir port pathlib
2018-10-12 08:33:47 -03:00
Ronny Pfannschmidt 00716177b4 fix missed Path import 2018-10-11 07:15:09 +02:00
Bruno Oliveira 5436e42990 Use pytest.fail(..., pytrace=False) when treating user errors
This prevents an enormous and often useless stack trace from showing
to end users.

Fix #3867
Fix #2293
2018-10-10 19:16:53 -03:00
Bruno Oliveira 9a3836a0cf Merge remote-tracking branch 'upstream/master' into merge-master-into-features 2018-10-09 19:34:04 -03:00
Anthony Sottile 1caf6d5907 Upgrade pre-commit hooks 2018-10-08 10:10:46 -07:00
Ronny Pfannschmidt 66609665f2
Merge pull request #4076 from nicoddemus/unittest-param-fixture-msg
Improve error message when TestCase functions use a parametrized fixture
2018-10-06 07:43:57 +02:00
Bruno Oliveira 212937eb3e Improve error message when TestCase functions use a parametrized fixture
Fix #2535
2018-10-03 19:43:46 -03:00
Bruno Oliveira 70c7273640 Fix request.fixturenames to return fixtures created dynamically
Fix #3057
2018-10-03 18:50:14 -03:00
Bruno Oliveira 56d0b5a7e2 Merge remote-tracking branch 'upstream/master' into merge-master-into-features 2018-09-22 18:14:36 -03:00
Bruno Oliveira 41f6ea13ce Fix 'Package has no len()' error during collection
Fix #3749
2018-09-20 17:53:21 -03:00
Bruno Oliveira 27772f67c0
Merge pull request #3987 from nicoddemus/fix-find-scope-3941
Fix scope determination with indirect parameters
2018-09-19 20:06:45 -03:00
Bruno Oliveira 86a14d007d Fix scope determination with indirect parameters
Fix #3941
2018-09-14 21:33:59 -03:00
Bruno Oliveira 87ddb2dbd5 Change flaky test_request_garbage to provide more debug information
This test fails *very* rarely when running in xdist.
2018-09-14 15:25:45 -03:00
Bruno Oliveira feb8240410 Use self.Function again during collection 2018-09-13 15:44:02 -03:00
Bruno Oliveira 482bd5efd2 Show deprecation warning for cached_setup 2018-09-13 14:25:46 -03:00
Ronny Pfannschmidt a0ce9a4441 remove the legacy code about im_func and generalize using fix and compat.getimfunc 2018-09-13 15:38:36 +02:00
Bruno Oliveira c00d934b21
Merge pull request #3933 from nicoddemus/idval-hypothesis-flaky-3707
Use -n auto now that xdist behaves well in Travis and AppVeyor
2018-09-06 15:15:55 -03:00
Bruno Oliveira 5eb85efa14 Use -n auto now that xdist behaves well in Travis and AppVeyor
This hopefully fixes the flaky test_idval_hypothesis on AppVeyor

Fix #3707
2018-09-06 09:22:13 -03:00
Bruno Oliveira adc9ed85bc Fix test_idval_hypothesis 2018-09-04 18:49:20 -03:00
Bruno Oliveira 5a52acaa92 Make config no longer optional in parametrize id functions 2018-09-04 16:55:52 -03:00
Bruno Oliveira b42518acd5 Change std_warn to receive a single warning instance, addressed review suggestions 2018-09-04 14:20:42 -03:00
Bruno Oliveira 9965ed84da Show deprecation warnings by default if no other filters are configured
Fix #2908
2018-09-04 11:35:34 -03:00
Bruno Oliveira 78ac7d99f5 Deprecate Config.warn and Node.warn, replaced by standard warnings 2018-09-04 11:35:34 -03:00
Bruno Oliveira 0c8dbdcd92 Fix existing tests now that we are using standard warnings 2018-09-04 11:35:34 -03:00
Bruno Oliveira 29e114b463 Try to fix test in MacOS-X 2018-08-27 19:27:51 -03:00
turturica 8cf0e46bbf test_package_ordering: Collect *.py, but keep a mix of case for filenames. The test doesn't make sense for Windows, because of its case-insensitivity. 2018-08-24 16:23:50 -07:00
Bruno Oliveira f0226e9329 Fix test_package_ordering on Windows 2018-08-24 20:15:33 -03:00
turturica dce8df45d5 Added changelog items. 2018-08-24 15:51:42 -07:00
turturica e3df1031ca Add encoding: utf8 for python 2.7 2018-08-24 12:26:18 -07:00
turturica 459b040d21 Fix dedent after merge. 2018-08-24 11:54:04 -07:00
turturica 3396225f74 Merge branch 'master' of github.com:pytest-dev/pytest into fix-3854 2018-08-24 11:47:24 -07:00
turturica 5f8b50c094 Address #3796 and add a test for it. 2018-08-23 22:48:44 -07:00
Anthony Sottile 85482d575e Replace Source with dedent where possible 2018-08-23 09:06:17 -07:00
Anthony Sottile 0fc4a806e5 py.builtins._totext -> string literals or six.text_type 2018-08-22 23:00:04 -07:00
turturica 4d3c1ab4f0 Fixes #3854 2018-08-22 21:42:59 -07:00
turturica e92893ed24 Add test for packages mixed with modules. 2018-08-10 17:29:30 -07:00
Bruno Oliveira dcafb8c48c Add example for package recursion bug 2018-08-03 15:40:33 -03:00
Ronny Pfannschmidt ca0476953e
Merge pull request #3751 from nicoddemus/collect-file-bug
Workaround for #3742
2018-08-02 07:35:46 +02:00
Ronny Pfannschmidt 33769d0328
Merge pull request #3754 from nicoddemus/fix-function-call-warning
Refactor direct fixture call warning to avoid incompatibility with plugins
2018-08-02 07:17:15 +02:00
Bruno Oliveira c6b11b9f62 Refactor direct fixture call warning to avoid incompatibility with plugins
This refactors the code so we have the real function object right during
collection. This avoids having to unwrap it later and lose attached information
such as "async" functions.

Fix #3747
2018-08-01 16:38:43 -03:00
Bruno Oliveira 43664d7841 Use ids for parametrized values in test_expected_value_type_error 2018-08-01 07:34:08 -03:00
Bruno Oliveira 6e32a1f73d Use parametrize in repr test for nd arrays 2018-08-01 07:04:25 -03:00
Bruno Oliveira e1ad1a14af Add example script and failure for #3742 2018-07-31 17:50:55 -03:00