Commit Graph

74 Commits

Author SHA1 Message Date
Anthony Sottile 205e29d843 Remove unnecessary `# noqa` comments.
Commit automated with https://github.com/asottile/yesqa
2017-12-22 08:29:48 -08:00
Bruno Oliveira 983a09a2d4 Merge remote-tracking branch 'upstream/master' into merge-master-into-features 2017-11-10 18:33:02 -02:00
Bruno Oliveira 03829fde8a Fix linting E741: ambiguous variable name 2017-11-04 13:59:10 -02:00
George Y. Kussumoto 03ce0adb79 Fix: handle CollectReport in folded_skips function 2017-10-04 19:18:55 -03:00
George Y. Kussumoto 06307be15d Add initial tests using skip with allow_module_level kwarg 2017-10-02 21:07:21 -03:00
prokaktus 98bf5fc9be Fold skipped tests with global pytestmark variable 2017-08-15 02:18:46 +03:00
Daniel Hahler 869eed9898 Fix lineno offset in show_skipped
The line number is 0-based here, so add 1.
2017-07-25 15:19:47 +02:00
Andras Tim 7248b759e8 Fixed E303 flake8 errors
too many blank lines (3)
2017-07-17 01:44:23 +02:00
Andras Tim b840622819 Fixed E302 flake8 errors
expected 2 blank lines, found 0
2017-07-17 01:44:23 +02:00
Andras Tim 195a816522 Fixed E265 flake8 errors
block comment should start with ‘# ‘
2017-07-17 01:44:22 +02:00
Andras Tim 8f3eb6dfc7 Fixed E261 flake8 errors
at least two spaces before inline comment
2017-07-17 01:44:22 +02:00
Andras Tim b226454582 Fixed E251 flake8 errors
unexpected spaces around keyword / parameter equals
2017-07-17 01:44:22 +02:00
Andras Tim 4b22f270a3 Fixed E226 flake8 errors
missing whitespace around arithmetic operator
2017-07-17 01:44:22 +02:00
Andras Tim 2e8caefcab Fixed E225 flake8 errors
missing whitespace around operator
2017-07-17 01:44:22 +02:00
Andras Tim df54bf0db5 Fixed E131 flake8 errors
continuation line unaligned for hanging indent
2017-07-17 01:28:16 +02:00
Bruno Oliveira 221f42c5ce Change --strict help message to clarify it deals with unregistered markers
Fix #2444
2017-07-04 20:14:57 -03:00
Bruno Oliveira 42a5d6bdfa Add __future__ imports to all pytest modules
This prevents silly errors from creeping in Python 2 when testing in Python 3
2017-03-16 22:45:40 -03:00
Bruno Oliveira 1e0cf5ce4d Merge remote-tracking branch 'upstream/master' into merge-master-into-features
# Conflicts:
#	AUTHORS
#	CHANGELOG.rst
#	_pytest/pytester.py
2017-03-10 15:54:05 -03:00
Michal Wajszczuk fb0b90646e New-style classes implemented for python 2.7 - #2147 2017-02-16 20:28:17 +01:00
Vidar Tonaas Fauske 832c89dd5f Test for `pytest.mark.xfail` with non-Python Item 2017-02-03 17:13:05 +01:00
Bruno Oliveira 336d7900c5 Fix test about pytest.skip message being used at global level
Fix #1959
2016-10-01 13:38:52 -03:00
Daniel Hahler e306a53999 Fix spelling: s/outside a/outside of a/ 2016-08-20 18:43:39 +02:00
Bruno Oliveira 463e6572c5 Merge branch 'master' into merge-master-into-features
Preparing for 3.0
2016-08-17 22:39:23 -03:00
Raphael Pierzina d1f2f779ee Use a better xfail reason 2016-08-17 22:31:56 +01:00
Raphael Pierzina 018197d72a Fix broken test in test_skipping and add one for strict xfail 2016-08-17 22:14:51 +01:00
Bruno Oliveira 458ecae1df Replace all usages of "pytest_funcarg__" for @pytest.fixture 2016-07-11 22:21:52 -03:00
RedBeardCode 0e2ebc96ff Remove deprecated cmd options
Fixes #1657
2016-06-26 19:26:04 +02:00
Omar Kohl d81f23009b Raise CollectError if pytest.skip() is called during collection
pytest.skip() must not be used at module level because it can easily be
misunderstood and used as a decorator instead of pytest.mark.skip, causing the
whole module to be skipped instead of just the test being decorated.

This is unexpected for users used to the @unittest.skip decorator and therefore
it is best to bail out with a clean error when it happens.

The pytest equivalent of @unittest.skip is @pytest.mark.skip .

Adapt existing tests that were actually relying on this behaviour and add a
test that explicitly test that collection fails.

fix #607
2016-06-24 20:56:21 +02:00
TomV 99c4b6fdc3 issue 1496 - xfail with condition keyword 2016-04-19 18:12:37 +01:00
Quentin Pradet 653a53226a Add strict parameter to xfail marker doc 2016-03-22 16:01:51 +04:00
Quentin Pradet 1fbd19b8cb Fix pytest.mark.skip mark when used in strict mode 2016-03-22 15:40:34 +04:00
Bruno Oliveira d9ede1bac2 Add test for unconditional skip with reason 2016-02-25 20:02:34 -03:00
Bruno Oliveira 0eeb466f11 Fix strict xfail: it should behave exactly like xfail when a test fails 2016-02-15 19:18:48 -02:00
Bruno Oliveira ee88679c54 Fix bug in strict xfail: test was not being actually called 2016-02-15 18:43:45 -02:00
Bruno Oliveira 7823838e69 Add strict option to xfail, making tests which XPASS to actually fail the suite
Fix #1355
2016-02-14 20:52:27 -02:00
Michael Aquilina 8984177448 TestXFail also shouldnt explicitly inherit from object 2015-10-03 17:12:44 +01:00
Michael Aquilina 00d0c74657 Update reason in test to prevent confusing with test_no_reason 2015-10-03 17:01:21 +01:00
Michael Aquilina fc0bd9412c Test that "unconditional skip" is the default reason if none given 2015-10-03 17:00:16 +01:00
Michael Aquilina 5ff9a0ff54 Remove redundant comments 2015-10-03 16:59:27 +01:00
Michael Aquilina 25d74a5919 Dont explicitly inherit from object 2015-10-03 16:55:04 +01:00
Michael Aquilina 213dbe7a5f newlines 2015-10-03 16:42:15 +01:00
Michael Aquilina 9e57954b03 First argument in pytest.mark.skip is a reason 2015-10-03 16:42:15 +01:00
Michael Aquilina 1b5aa2868d Check no reason displayed if none specified 2015-10-03 16:42:15 +01:00
Michael Aquilina 04545f8a54 classes inherit from object 2015-10-03 16:42:15 +01:00
Michael Aquilina d1628944a6 Update skippings tests for better coverage 2015-10-03 16:42:15 +01:00
Michael Aquilina 771aef9ddb Add a test_skip_class test 2015-10-03 16:42:15 +01:00
Michael Aquilina f144666f8b Work towards test coverage of mark.skip 2015-10-03 16:42:14 +01:00
Abhijeet Kasurde dd69394598 Added testcase and help for report option
Fix added to show help of new reporting option 'a'.
Also, added testcase for checking reporting functionality
with option 'a'.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2015-09-11 12:24:45 +05:30
Bruno Oliveira 953916df49 Report correct reason when using multiple skip/xfail markers 2015-07-18 18:18:45 -03:00
Bruno Oliveira 9d4e0365da Skipif marker report now refers to the skipped function
Fix #114
2015-06-18 21:59:44 -03:00