Commit Graph

430 Commits

Author SHA1 Message Date
Ronny Pfannschmidt df37cdf51f Merge pull request #2808 from georgeyk/allow-module-level-skip
Allow module level skip
2017-10-12 06:50:53 +02:00
Hugo be0e2132b7 Update authors [CI skip] 2017-10-10 10:01:15 +03:00
George Y. Kussumoto 0668a6c6d3 Add myself to authors file 2017-10-04 22:14:29 -03:00
Thomas Hisch 296ac5c476 Add thisch to AUTHORS 2017-09-26 23:24:27 +02:00
Bruno Oliveira 9273e11f21 Merge branch 'master' into features 2017-09-07 13:59:10 -03:00
Xuan Luong 3f8ff7f090 [DOC] Add examples for mark.with_args 2017-09-06 14:26:28 -04:00
Bruno Oliveira f825b4979b Merge remote-tracking branch 'upstream/master' into features 2017-09-05 19:44:33 -03:00
Tarcisio Fischer de6b41e318 Update changelog and AUTHORS files, following the CONTRIBUTING guidelines 2017-09-05 15:46:32 -03:00
prokaktus 98bf5fc9be Fold skipped tests with global pytestmark variable 2017-08-15 02:18:46 +03:00
Srinivas Reddy Thatiparthy a0101f024e remove os.sep as it behaves differently linux and windows.
* on linux it is '/'

* on windows it is '\'
2017-08-05 23:21:43 +05:30
Bruno Oliveira 763c580a2a Merge pull request #2576 from maiksensi/feat/raise-not-implemented-for-lt-gt-in-approx
#2003 Change behavior of `approx.py` to only support `__eq__` comparison
2017-07-30 17:48:33 -03:00
Bruno Oliveira 713f7636e1 Merge pull request #2632 from jmoldow/pep_0415_suppress_exception_context
Support PEP-415's Exception.__suppress_context__
2017-07-30 17:22:40 -03:00
Bruno Oliveira 4cd8727379 Merge pull request #2617 from wence-/fix/nondeterministic-fixtures
Fix nondeterminism in fixture collection order
2017-07-30 17:17:40 -03:00
Jordan Moldow 2e61f702c0 Support PEP-415's Exception.__suppress_context__
PEP-415 states that `exception.__context__` should be suppressed
in traceback outputs, if `exception.__suppress_context__` is
`True`.

Now if a ``raise exception from None`` is caught by pytest,
pytest will no longer chain the context in the test report.

The algorithm in `FormattedExcinfo` now better matches the one
in `traceback.TracebackException`.

`Exception.__suppress_context__` is available in all of the
versions of Python 3 that are supported by pytest.

Fixes #2631.
2017-07-29 02:39:17 -07:00
Bruno Oliveira 3d89905114 Merge remote-tracking branch 'upstream/master' into features 2017-07-26 19:01:28 -03:00
Mihai Capotă 10ded399d8 Show multiple issue links in CHANGELOG entries
Restores the functionality removed in PR #2488.
2017-07-26 10:58:06 -07:00
Lawrence Mitchell a546a612bd Fix nondeterminism in fixture collection order
fixtures.reorder_items is non-deterministic because it reorders based
on iteration over an (unordered) set.  Change the code to use an
OrderedDict instead so that we get deterministic behaviour, fixes #920.
2017-07-26 14:41:10 +01:00
Maik Figura 1851f36beb Add PR requirements changelog and authors 2017-07-25 19:19:14 -03:00
Bruno Oliveira abb5d20841 Merge branch 'master' into features 2017-07-20 22:10:58 -03:00
Floris Bruynooghe 56e6b4b501 Merge pull request #2578 from Llandy3d/2375
Provides encoding attribute on CaptureIO
2017-07-20 23:14:14 +02:00
Bruno Oliveira d44565f385 Merge remote-tracking branch 'upstream/master' into fix-flake8-errors 2017-07-19 17:57:30 -03:00
Bruno Oliveira c92760dca8 Merge branch 'fix-flake8-issues' 2017-07-19 17:03:36 -03:00
Bruno Oliveira 4fd92ef9ba Merge branch 'fix-flake8-issues' into features 2017-07-17 21:05:39 -03:00
Andras Tim b2a5ec3b94 updated meta 2017-07-17 02:16:51 +02:00
Llandy Riveron Del Risco ba9a76fdb3 Provides encoding attribute on CaptureIO
Fix #2375
2017-07-16 14:29:00 +02:00
Martin Altmayer cc39f41c53 Add myself to AUTHORS as required by the PR help text. 2017-07-15 13:54:18 +02:00
Nathaniel Waisbrot 9b9fede5be
allow staticmethods to be detected as test functions
Allow a class method decorated `@staticmethod` to be collected as a test
function (if it meets the usual criteria).

This feature will not work in Python 2.6 -- static methods will still be
ignored there.
2017-06-29 07:44:36 -04:00
Segev Finer f74f14f038 Fix --help with required options
This works by adding an argparse Action that will raise an exception in
order to skip the rest of the argument parsing. This prevents argparse
from quitting due to missing required arguments, similar to the way that
the builtin argparse --help option is implemented by raising SystemExit.

Fixes: #1999
2017-06-01 21:29:50 +03:00
Bruno Oliveira 7950c26a8e Add Hui Wang to AUTHORS list 2017-05-26 08:09:29 -03:00
Dmitri Pribysh bcfa6264f1 Update AUTHORS list 2017-05-12 17:48:50 -03:00
Bruno Oliveira f3b359f5b8 Merge remote-tracking branch 'upstream/master' into merge-master-into-features
# Conflicts:
#	_pytest/capture.py
#	_pytest/compat.py
#	_pytest/python.py
#	testing/python/collect.py
#	testing/test_mark.py
2017-05-03 19:04:53 -03:00
Vitaly Lashmanov 60b8339166 Issue #2383 - Show the correct error message when collect "parametrize" func with wrong args and add test for this case. 2017-04-29 14:32:09 +03:00
Kodi Arfer dcefb287fc Try not to assume a module's file extension is .py 2017-04-19 12:26:56 -07:00
Jonas Obrist 08d83a5c6a updated changelog and authors files 2017-04-10 17:50:18 +09:00
Skylar Downes 3aa4fb62d6 Merge branch 'master' into master 2017-04-06 16:35:38 -07:00
Paweł Adamczak 8b57aaf944 Added 'Paweł Adamczak' to AUTHORS 2017-03-19 18:38:41 +00:00
Xander Johnson 9062fbb9cc Add AUTHORS & CHANGELOG 2017-03-14 18:55:58 -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
fbjorn cee578e327 Fix trailing whitespace in terminal output 2017-03-05 23:20:55 +03:00
Omer Hadari dd25ae7f33 added in the correct alphabitcal order 2017-03-04 12:50:02 +02:00
Omer Hadari 02dc545311 added in the correct alphabitcal order 2017-03-04 12:49:00 +02:00
Omer Hadari 6aaf7ae18b added to authors and changelog 2017-03-04 10:32:14 +02:00
Anthony Sottile 6ba3475448 Make capsys more like stdio streams in python3. Resolves #1407. 2017-02-23 17:46:27 -08:00
Michal Wajszczuk fb0b90646e New-style classes implemented for python 2.7 - #2147 2017-02-16 20:28:17 +01:00
Patrick Hayes 00ec30353b Update docs as requested 2017-02-14 17:08:42 -08:00
Ran Benita 3a0a0c2df9 Ignore errors raised from descriptors when collecting fixtures
Descriptors (e.g. properties) such as in the added test case are
triggered during collection, executing arbitrary code which can raise.
Previously, such exceptions were propagated and failed the collection.
Now these exceptions are caught and the corresponding attributes are
silently ignored.

A better solution would be to completely skip access to all custom
descriptors, such that the offending code doesn't even trigger. However
I think this requires manually going through the instance and all of its
MRO for each and every attribute checking if it might be a proper
fixture before accessing it. So I took the easy route here.

In other words, putting something like this in your test class is still
a bad idea...:

    @property
    def innocent(self):
        os.system('rm -rf /')

Fixes #2234.
2017-02-07 14:27:34 +02:00
Bruno Oliveira ccf9877447 Merge pull request #2232 from vidartf/patch-1
Do not asssume `Item.obj` in 'skipping' plugin
2017-02-03 21:39:42 -02:00
Bruno Oliveira a4d2a5785b Merge pull request #2142 from barneygale/xfail_without_condition_getglobals
'xfail' markers without a condition no longer rely on the underlying `Item` objects deriving from `PyobjMixin`
2017-02-03 16:09:47 -02:00
Vidar Tonaas Fauske 1a88a91c7a Update authors/history 2017-02-03 16:29:43 +01:00
Ronny Pfannschmidt 3b47cb45e6 Merge pull request #2222 from RonnyPfannschmidt/features
merge master into features
2017-01-26 13:48:10 +01:00
Ronny Pfannschmidt 713bdc1f9f merge master into features 2017-01-26 12:00:52 +01:00
Victor Uriarte 839aa963a1 Add py36 identifier
and order AUTHORS
2017-01-22 17:13:17 -07:00
Ravi Chandra c848d0a771 Pass parameter name to `make_parametrize_id` hook function 2017-01-21 16:46:45 +13:00
Eli Boyarski e18b2a427a Fail assert_outcomes() on missing terminal report
Currently if the terminal report of testdir.runpytest() is missing,
assert_outcomes() on its output fails because parseoutcomes()
returns an unexpected value (None).
It's better to fail parseoutcomes() directly.
2017-01-11 17:09:37 +02:00
mandeep e412ea1d5a Added name to AUTHORS and change to CHANGELOG 2017-01-10 07:58:22 -06:00
Jeff Widman 6d81c684cc Switch monkeypatch fixture to yield syntax 2017-01-04 15:06:52 -08:00
Barney Gale 8db9915374 Update AUTHORS, CHANGELOG 2017-01-02 22:01:04 +00:00
Bruno Oliveira 402fbe503a Merge branch 'master' into merge-master-into-features 2016-12-27 23:31:26 -02:00
Loïc Estève bfada968d3 Update AUTHORS and CHANGELOG.rst
following contribution guidelines
2016-12-20 14:36:10 +01:00
Manuel Krebber 1f62e5b5a0 Added CHANGELOG entry and myself to AUTHORS. 2016-11-30 11:50:11 +01:00
Bruno Oliveira b30a6d22c5 Merge branch 'master' into merge-master-into-features 2016-11-27 17:30:40 -02:00
nmundar 0e6ad8e59f update CHANGELOG and AUTHORS 2016-11-27 14:24:55 -02:00
Luke Murphy 1aa5bfea11 Add `:ref:` targets to `recwarn.rst`. 2016-11-26 18:41:38 +01:00
Duncan Betts c1b83cdeea Add hint of Issue #478 to error text 2016-11-26 10:47:15 +00:00
Ned Batchelder 06bb61bbe3 Don't fail if imp can't find the source for a .pyc file. #2038 2016-11-20 13:09:32 -05:00
Bruno Oliveira efc54b2e56 Merge branch 'master' into merge-master-features 2016-11-11 18:56:53 -02:00
Michael Seifert 1e5b21cd61 Fix memory leak with pytest.raises by using weakref 2016-11-08 22:12:23 -02:00
Dan Wandschneider e46e653794 Clean up unittest TestCase objects after tests are complete (#1649).
Fix #1649

Users of unittest style TestCases will create expensive objects
in setUp. We should clean up TestCase instances that are lying
around so that they don't fill up memory.
2016-11-07 18:32:56 -08:00
Mathieu Clabaut 6f93ffb5d4 Report teardown output on test failure
Until now, teardown stdout/stderr output was not reported upon test failure.
However such output is sometime necessary to understand the failure.

fix #442
2016-10-30 09:52:46 +01:00
Ronny Pfannschmidt 377e649e61 local merge of #1967 - Change exception raised by capture.DontReadFromInput.fileno() 2016-10-24 12:47:55 +02:00
Bruno Oliveira 9d00615bbf Merge remote-tracking branch 'upstream/master' into merge-master-into-features 2016-10-20 21:51:42 -02:00
Grigorii Eremeev 65ebc75ee8 Update fixture.rst
Removed redundant word
2016-10-05 22:26:13 +03:00
Bruno Oliveira 654af0ba25 Merge remote-tracking branch 'upstream/master' into features 2016-09-26 19:32:53 -03:00
Vlad Dragos ff492ca73f Thanked my self in the change log :) 2016-09-26 13:27:41 +03:00
Tyler Goodlet 6db2f315fa Explain a bad scope value to the user 2016-09-21 16:40:58 -04:00
Lev Maximov 6b56c36ae7 added to changelog and authors 2016-09-20 02:47:59 +07:00
Matthew Duck 4df74a5cfb Add AUTHORS and CHANGELOG for #1512 2016-09-19 15:29:37 +01:00
Floris Bruynooghe f484e7c9ca Merge pkg_resources workaround
Merge branch 'pkg_resources_bugfix' of github.com:raquel-ucl/pytest into pkg-resources

This is an odd case and doesn't really make sense, it is working around a bug
in maven/jython and the old version or weird packaging of setuptools they use.
But we used to do this in the past so might as well keep doing this.
2016-09-19 10:14:41 +01:00
Skylar Downes d781b76627 Update AUTHORS 2016-09-15 15:20:47 -07:00
mbyt 10b3274924 adding corresponding test, authors and changelog 2016-08-31 20:22:54 +02:00
Ahn Ki-Wook 86b8801470 Update AUTHORS and CHANGELOG 2016-08-26 09:42:17 +09:00
Jordan Guymon a152ea2dbb Add buffer attribute to stdin stub 2016-08-24 16:26:34 -07:00
Raquel Alegre 7d498fdc82 Added myself as AUTHOR as requested on PR. 2016-08-23 16:47:15 +01:00
Bruno Oliveira d99ceb1218 Merge pull request #1844 from nicoddemus/importer-error
Importer loader error
2016-08-22 20:47:25 -03:00
Bruno Oliveira b54ea74d4d Update AUTHORS and CHANGELOG for #1837 2016-08-22 17:59:42 -03:00
Andrew Svetlov 4e9c1fbe96 Remove duplicated name 2016-08-21 22:20:29 +03:00
Bruno Oliveira 745c8c17f1 Merge remote-tracking branch 'upstream/master' 2016-08-19 17:38:21 -03:00
matthiasha ccfa8d15bf Update AUTHORS 2016-08-19 09:04:19 +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
Christian Boelsen e4028b4505 Fix #1798 to include errors in total tests in junit xml output. 2016-08-08 13:35:49 +01:00
satoru 3c8222f1db Highlight the path of file location in error report
So that it's more obvious when we need to copy the file path.
2016-08-01 17:42:20 -03:00
Bruno Oliveira c2864aba3d Merge branch 'master' into merge-master
# Conflicts:
#	AUTHORS
#	CHANGELOG.rst
#	_pytest/monkeypatch.py
#	_pytest/python.py
2016-07-25 19:06:29 -03:00
Bruno Oliveira 8f29ce26e9 Merge branch 'mark_missing_fixture_error' of https://github.com/eolo999/pytest 2016-07-25 18:20:17 -03:00
Roberto Polli ab6aef1d1f feature: default behavior now is to ignore duplicate paths specified from the command line. Use --keep-duplicates to retain duplicate paths. 2016-07-25 12:41:58 +02:00
Dmitry Dygalo f7ad173fee Fixed collection of classes with custom ``__new__`` method 2016-07-25 11:33:37 +02:00
Tom Viner 42adaf5a61 Fix #1210 display msg for early calls to exit 2016-07-24 14:16:34 +02:00
JJ 4aede6faa6 fixed conflicts 2016-07-24 12:10:32 +02:00
Edoardo Batini e00199212c Add myself to the AUTHORS 2016-07-23 23:49:44 +02:00
Diego Russo 1704b7d265 Test case for overriding autouse fixtures
Test case for overriding autouse fixture with a parametrized fixture.
The test covers the problem explained in the issue 1601
Adding Diego Russo to AUTHORS
2016-07-23 16:53:39 +02:00
JJ 3631719050 added myself to authors 2016-07-23 16:51:55 +02:00
Romain Dorgueil fd8e019cc1 Choose the doctest output format in case of failure, still work in progress as a few checks fail (related to #1749) 2016-07-23 14:40:46 +02:00
Javi Romero 7e37497d5a Uppercase first word in docstrings. Change to an imperative form. Add name to authors. 2016-07-22 12:39:06 +02:00
Bruno Oliveira e0f08a73ab Merge branch 'features' into conftest-exception-printing 2016-07-20 19:33:36 -03:00
Bruno Oliveira 1266ebec83 Merge remote-tracking branch 'upstream/features' into warnings-displayed-by-default
# Conflicts:
#	CHANGELOG.rst
#	testing/test_terminal.py
2016-07-13 18:45:15 -03:00
Antony Lee 6383b53ad9 Allow passing a custom Pdb subclass via --pdbcls.
This obviates the need for plugins such as `pytest-ipdb`; instead one
can simply call `py.test --pdb=IPython.core.debugger:Pdb`
2016-07-09 21:10:52 -07:00
Javier Domingo Cansino 61e605f60b Making conftest import failures easier to debug 2016-07-05 10:04:42 +01:00
aostr e04d9ff80b * now showing pytest warnings summary by default.
* added ``--disable-pytest-warnings` flag to let users disable the warnings summary.
* extended/changed unit tests for the changes in the pytest core.
2016-06-25 18:16:13 +02:00
Ted Xiao 856e6cab75 add --override-ini option to overrides ini values
Signed-off-by: Ted Xiao <xiao.xj@gmail.com>
2016-06-25 23:45:32 +08:00
holger krekel 13a188fe37 Merge pull request #1647 from sallner/features
Add new options to report fixture setup and teardown
2016-06-25 16:38:37 +02:00
Stefan Zimmermann 69bab4ab04 added check for already existing option names to OptionGroup.addoption() 2016-06-22 18:01:35 +02:00
Steffen Allner dd97a2e7c8 Merge from upstream 2016-06-22 17:51:48 +02:00
Steffen Allner 0dbf77e08e Add to changelog and authors. 2016-06-22 17:37:58 +02:00
Ronny Pfannschmidt 18ef7de96b merge from master again 2016-06-22 16:03:52 +02:00
HEAD KANGAROO be1dabd6a9 cache.rst: Fix wrong command used
The "Inspecting Cache content" section was showing --cache-clear command,
  but should actually be using --cache-show command.

  Also; update AUTHORS
2016-06-22 14:04:02 +01:00
Ronny Pfannschmidt 083f64100d merge master into features 2016-06-22 14:39:33 +02:00
Bruno Oliveira 4350f499b2 Merge branch 'issue1629' of https://github.com/davehunt/pytest into features 2016-06-21 18:37:14 +02:00
Bruno Oliveira 573866bfad Merge remote-tracking branch 'upstream/features' into issue-1619-conftest-assert-rewrite 2016-06-21 18:10:19 +02:00
Dave Hunt 393167b94f Update CHANGELOG and add Oliver Bestwalter to AUTHORS 2016-06-21 16:59:14 +02:00
Omar Kohl ede7478dcc Exit pytest on collection error (without executing tests)
Add --continue-on-collection-errors option to restore the previous behaviour:
Execute tests (that were successfully collected) even when collection errors
happen.

Some tests had to be modified e.g. because the return code changed to 2
(EXIT_INTERRUPTED) instead of 1 (EXIT_TESTSFAILED) because an Interrupted
exception is raised on collection error.

Implemented via pair programming with:
    Oleg Pidsadnyi <oleg.pidsadnyi@gmail.com>

closes #1421
2016-06-21 13:32:34 +02:00
Tom Viner 5854a71ece Issue 460: getfuncargvalue fixture w. params err 2016-06-21 11:29:21 +02:00
Bruno Oliveira e0cb046885 Update AUTHORS and CHANGELOG 2016-06-20 23:16:06 +02:00
Bruno Oliveira d81ee9acfb Merge pull request #1597 from taschini/pyargs-fix
Ensure that a module within a namespace package can be found by --pyargs
2016-06-19 14:20:52 -03:00
Greg Price ab8b2e75a3 Simplify default pytest_runtestloop
The inner function and the explanatory comment it makes necessary can
all be removed if we switch to an if/else rather than try/except for
this condition.

Perhaps this bit comes from my fondness for C, but I think I would
find this style clearer and easier to understand even if it weren't
for the Python 2 quirk that makes the other style require us to add an
unnecessary-looking function abstraction.  In any case, given that the
alternative does require that abstraction this is definitely simpler.
2016-06-15 18:27:08 -07:00
taschini 1218392413 Added taschini to AUTHORS and #1597 to CHANGELOG.rst. 2016-06-14 07:16:20 +02:00
Guyzmo accd962c9f Fixed issue shadowing error when missing argument on teardown_method
When the method argument is missing on teardown_method, the traceback is
100% internal to pytest, which with default options get pruned. Then
that traceback is empty, leading to a new exception as a traceback shall
not be empty.

This PR fixes that issue by pushing back the last stack on the
traceback, when the stacktrace is empty after pruning. Then the output
is still pruned, but gives meaningful information with the item where it
failed on the stack.

* fixes issue #1604

Signed-off-by: Guyzmo <guyzmo+github@m0g.net>
2016-06-12 03:45:24 +02:00
marscher 09d163aa3a [exception handling] Fix case the current working directory (CWD) gets deleted during testing.
Fixes #1235.
2016-06-08 15:18:23 +02:00
Bruno Oliveira 63ced4d486 List contributors alphabetically in AUTHORS 2016-06-01 20:21:51 -03:00
Bruno Oliveira dd9c81ca26 Mention #1580 in the CHANGELOG and add Thomas Grainger to AUTHORS 2016-06-01 19:56:45 -03:00
Bruno Oliveira 8c1be624a6 Merge pull request #1554 from RonnyPfannschmidt/merge-master
Merge master into features
2016-05-24 11:09:33 -03:00
AbdealiJK d4c9fa9f1a unittest.UnitTestCase: Allow __test__ for methods
__test__ needs to be checked for methods of a class too. Earlier,
this was not done, and all methods in a class was assumed to be
a test. This commit adds the appropriate condition to ensure that
if the __test__ is set to False, it does not collect that method.

Fixes https://github.com/pytest-dev/pytest/issues/1558
2016-05-19 08:19:57 +05:30
Ronny Pfannschmidt eab762ea99 Merge branch 'master' into merge-master 2016-05-13 19:37:41 +02:00
Ronny Pfannschmidt c49863aa63 merge next chunk from master and fix changelog linting issue 2016-05-13 19:36:47 +02:00
Ronny Pfannschmidt 01d2ff804b Merge commit '56156bb119194014129ac08c4a2c370f0b893104' into merge-master 2016-05-13 17:55:02 +02:00
John Towler 0d07b64571 Fixes Issue 1549 2016-05-05 11:29:05 -07:00
Meng Jue dd2425675b Fix a small issue about shlex.split not working well with win32 path 2016-04-19 13:08:08 +08:00
Martin Prusse 7ce5873da2 Perform a "unicode aware" check for maximum recursion depth error
Avoid errors `UnicodeErrosr`s due non maximum recursion depth errors
when checking for those errors.
2016-04-08 23:32:18 -03:00
Ronny Pfannschmidt 0f7aeafe7c Merge pull request #1486 from roolebo/fix-issue-138
Fix issue #138 - support chained exceptions
2016-04-03 19:21:57 +02:00
Omar Kohl 0c38aacc33 Add self to AUTHORS 2016-04-03 11:23:30 +02:00
Quentin Pradet 1fbd19b8cb Fix pytest.mark.skip mark when used in strict mode 2016-03-22 15:40:34 +04:00
Roman Bolshakov 52bc2f8616 Update authors & changelog 2016-03-20 01:06:53 +03:00
Bruno Oliveira 5fcce8a7d6 Merge branch 'master' into merge-master-into-features 2016-03-18 18:26:56 -03:00
Tareq Alayan fa6acdcfd4 junitxml: add properties node in testsuite level
The commit allow users to add a properties node in testsuite level see
example below:

<testsuite errors="0" failures="0" name="pytest" skips="1" tests="1"
time="11.824">
  <properties>
    <property name="ARCH" value="PPC"/>
    <property name="OS" value="RHEL 7.2"/>
    <property name="TestPlanURL" value="https://url.."/>
    <property name="Automated" value="True"/>
  </properties>
  <testcase classname="git.....>
  </testcase>
</testsuite>

The current situation is that properties node can be added to every
testcase node. However, sometimes we need some global properties that
applies to all testcases and give better description for the testsuite
itself.
2016-03-16 13:24:33 +02:00
Ronny Pfannschmidt d70596da91 Merge pull request #1452 from palaviv/specify-paramterized-node-in-command-line
Specify paramterized node in command line - fixes #649
2016-03-16 11:16:54 +01:00
Kale Kundert 5ceee08590 Fix CHANGELOG merge conflicts. 2016-03-14 11:55:50 -07:00
palaviv 981fcb2798 added CHANGELOG and AUTHORS entry 2016-03-13 23:47:41 +02:00
Daniel Hahler bdddc9c38b doc: fix argument order for pytest_load_initial_conftests 2016-03-12 17:35:27 +01:00
Mike Lundy 9577120592 Allow custom fixture names for fixtures
When defining a fixture in the same module as where it is used, the
function argument shadows the fixture name, which a) annoys pylint and
b) can lead to bugs where you forget to request a fixture into a test
method.

This allows one to define fixtures with a different name than the name
of the function, bypassing that problem.
2016-03-09 14:58:54 -08:00
Kale Kundert 4d0f066db7 Add approx() to the CHANGELOG. 2016-03-07 18:29:22 -08:00
Matt Bachmann 8ce32b0795 When a regex pattern contains bytes instead of a string use escape_encode to turn it into a string before further processing. Thanks @nicoddemus for the review and tips! 2016-03-05 21:04:34 -05:00
Matt Williams 891e029518 Add a new doctest_namespace fixture
This fixture can be used to inject names into the namespace in which
your doctests run.
2016-03-02 12:43:57 +00:00
Lukas Bednar 7e758a9dc6 junit: allow multiple properties with same name
It might happen that test can be affected by two or more bugs.
I need to be able to track them all.
2016-02-29 16:00:26 +01:00
Ryan Wooden d98d655094 Simplify IndexError test. 2016-02-26 08:25:49 -04:00
Bruno Oliveira a7b907d325 Add Raphael Pierzina to AUTHORS 2016-02-23 20:29:08 -03:00
Bruno Oliveira 199fcf93d4 Merge branch 'master' into 'features' 2016-01-22 18:32:45 -02:00
Bruno Oliveira dd56d7b7fc Add CHANGELOG and AUTHORS entry for #1334 2016-01-20 19:00:52 -02:00
foxx f46de68804 Fixes bug with stdout/stderr capture on pdb 2016-01-09 12:04:26 +00:00
Ronny Pfannschmidt 6c170201d6 Merge branch 'master' into features 2016-01-02 23:56:01 +01:00
Bruno Oliveira 1bdf71730a Complement #1255 by adding tests and docs
Fix #1242
2015-12-30 18:24:59 -02:00
Erik M. Bray 6e170a4a1c * Moved workaround to its own function, mostly for the sake of adding
a more descriptive docstring (the workaround itself is just to import
  readline earlier).  I removed the conditional on targetfd from the
  workaround since it doesn't really matter.

* Added # noqa marker.

* Added changelog entry, and self to authors.
2015-12-24 16:43:34 -05:00
Bruno Oliveira 6ac31088c5 Merge branch 'master' into merge-master-into-features 2015-12-11 23:13:50 -02:00
aselus-hub 2b2240e904 added myself to authors, added changelog entry. 2015-12-10 15:15:09 -08:00
Bruno Oliveira 8b61a332ba Merge remote-tracking branch 'bukzor/features-merge-master' into features 2015-12-10 19:03:55 -02:00
Buck Golemon eabf2f9091 Merge branch 'master' into features
Conflicts:
	AUTHORS
	_pytest/__init__.py
	_pytest/hookspec.py
	_pytest/recwarn.py
	testing/test_recwarn.py
2015-12-07 14:28:59 -08:00
David Vierra 1db4cbcc9f Update AUTHORS and CHANGELOG 2015-12-07 12:17:30 -10:00
Lee Kamentsky 313050b15b Suggested edits by Bruno.
Moved fix to TestCaseFunction.setup. Added myself to AUTHORS and added entry to CHANGELOG
2015-11-04 15:30:16 -05:00
gabriel.reis a83d5c0f08 Updated entries on CHANGELOG and AUTHORS. Ref: #1157 2015-10-28 19:35:04 +00:00
Michael Birtwell a3bda59a30 collection: Prevent non-function callables from being collected
Fixes issue 331
previously to this change the collection code would issue a warning for
when ever it encountered a variable that looked like a test but wasn't a
function saying that it wouldn't collect it because it wasn't a function.
This fixes the logic so that if that warning is issued it really isn't
collected.
However previously special cases existed to support tests that were
created using functools.wraps and functools.partial. So the condition for
issuing that warning has been updated to take that in to account

Also try the old way of detecting functions just for proper integration
with mock.path in python 2.7 the get_real_func returned the unbound method
2015-10-12 22:23:18 +01:00
Michael Aquilina 122980ecad Add myself to AUTHORS 2015-10-03 17:01:11 +01:00
holger krekel cb58eaa611 Merge remote-tracking branch 'upstream/master' into features
Conflicts:
	_pytest/__init__.py
	testing/test_recwarn.py
2015-09-29 15:56:41 +02:00
holger krekel 95245b935c - fix a flaky test on py35-xdist by calling
importlib.invalidate_caches()

- bump version to 2.8.1

- regen docs

- amend changelog, authors
2015-09-29 13:10:59 +02:00
Galaczi Endre beaa8e55bd Fixes #653 use deprecated_call as context_manager 2015-09-21 19:01:23 +01:00
holger krekel baf5b5d005 update changelog/author info, bump version number 2015-09-17 13:43:39 +02:00
elizabeth e67d66a5d4 Merge branch 'pytest-dev'
# Conflicts:
#	AUTHORS
2015-08-24 22:55:11 +03:00
Ronny Pfannschmidt b25e41e348 Merge pull request #956 from nicoddemus/record-xml-property
add preliminary support for extended junit xml properties
2015-08-24 09:13:04 +02:00
David Diaz 2ddbac1f98 Correcting implementation based on pull request feed back 2015-08-21 14:31:53 -06:00
Bruno Oliveira 2ffd37b816 return non-zero exit code if no tests are collected
Fix #812
Fix #500
2015-08-18 07:35:02 -03:00
Markus Unterwaditzer 1d5215ab4f Add myself to authors 2015-08-11 00:47:18 +02:00
Abhijeet Kasurde ab9befb197 Updated CHANGELOG and AUTHORS 2015-08-05 15:21:37 +05:30
elizabeth 54a3d6210b Update CHANGELOG and AUTHORS 2015-08-02 20:39:31 +03:00
Eric Hunsberger aac371cf07 Added myself to AUTHORS 2015-07-30 23:28:32 -04:00
Anatoly Bubenkov 6af7172204 Merge branch 'pytest-2.7' 2015-07-19 15:25:04 +02:00
Bruno Oliveira d10054a38d Merge branch 'esiegerman/summary_colors' of github.com:esiegerman/pytest 2015-07-03 18:29:17 -03:00
Kevin Cox 7fa27af408 Add `file` and `line` attributes to junit-xml output.
This adds the `file` and `line` attributes to the junit-xml output
which can be used by tooling to identify where tests come from. This can be
used for many things such as IDEs jumping to failures and test
runners evenly balancing tests among multiple executors.

Update test_junitxml.py

Foo.
2015-07-02 18:41:52 -04:00
Eric Siegerman 2c419c4790 Add CHANGELOG and AUTHORS entries 2015-07-02 15:47:03 -04:00
Pieter Mulder 75679f08c9 Update AUTHORS and CHANGELOG 2015-06-25 17:38:45 +02:00
holger krekel ee40ea5f6d Merge branch 'pytest-2.7'
Conflicts:
	AUTHORS
	_pytest/__init__.py
	setup.py
	testing/conftest.py
	tox.ini
2015-06-23 16:49:05 +02:00
Edison Gustavo Muenz 48d91def7e Added workaround to still show the diff on containers with unsortable elements.
fix issue #718
2015-06-19 07:51:59 -03:00
Anatoly Bubenkov 4d6fef36f4 Merge branch 'pytest-2.7' 2015-06-17 13:42:41 +02:00
Bruno Oliveira ae89436d97 Remove duplicated author from AUTHORS 2015-06-17 00:05:56 -03:00
Bruno Oliveira 2a1424e563 Merge branch 'pytest-2.7' of github.com:curzona/pytest into pytest-2.7
Conflicts:
	AUTHORS
	CHANGELOG
2015-06-17 00:02:26 -03:00
curzona 1871d526ac Update CHANGELOG and AUTHORS 2015-06-16 19:33:26 -07:00
Punyashloka Biswal 0c05b906d4 backport fix for #713 2015-06-16 21:27:22 -03:00
Bruno Oliveira f04e01f55f Sort AUTHORS names 2015-06-16 21:20:43 -03:00
Punyashloka Biswal 0b0406fa85 Handle reports that don't have a reprcrash
Closes #713 (which happens because ReprFailDoctest
doesn't have a reprcrash)
2015-06-16 18:53:20 -04:00
Ronny Pfannschmidt 33a7f03ccc sort AUTHORS and add Janne 2015-06-06 13:38:25 +02:00
holger krekel c92467df2f add changelog for latest merge 2015-06-03 23:39:00 +02:00
Floris Bruynooghe 240cd1f28d Merge cleaning of sys.modules after pytester.inline_run()
Merged in schettino72/pytest/pytester-inline-run-clean-sys-modules
(pull request #278).
2015-04-21 11:00:32 +01:00
Eduardo Schettino bc0ecd1d06 pytester: add method ``TmpTestdir.delete_loaded_modules()``
, and call it from ``inline_run()`` to allow temporary modules to be reloaded.

--HG--
branch : pytester-inline-run-clean-sys-modules
2015-04-21 10:18:04 +08:00
holger krekel 8ed5b77aba fix issue650: introduce new --doctest-ignore-import-errors option courtesy
of Charles Cloud.
2015-02-26 22:02:49 +01:00
Dave Hunt d1adbf4a5c Added documentation for PYTEST_ADDOPTS environment variable, updated CHANGELOG and AUTHORS.
--HG--
branch : env-addopts
2015-02-09 14:11:54 +00:00
TomV f6caf230f8 fix for issue615: _format_boolop must escape %
fix test for issue615: expression must eval False

--HG--
branch : format_boolop_percent6
2014-10-27 08:57:58 +00:00
holger krekel ba878c6d9d add changelog entry and refactor unittest.mock.patch fix a bit 2014-07-28 10:34:01 +02:00
holger krekel c2ed29070a address issue170 by merging David Mohr's PR on adding "raises" as an optional
argument to pytest.mark.xfail.
2014-07-28 09:59:22 +02:00
holger krekel 040062e40c improve example for pytest integration with "python setup.py test"
which now has a generic "-a" or "--pytest-args" option where you
can pass additional options as a quoted string.  Thanks Trevor Bekolay.
2014-05-19 20:32:09 +02:00
Andy Freeland 2ba23e8d08 issue504: verbose output displays node IDs for each test
Replace the verbose per-test reporting format of `file:line test_name RESULT`
with the node ID of the test, i.e. `file@line::class::method[param] RESULT`.

This patch does not update the examples in the docs; @hpk42 has a script
to regenerate those.

--HG--
branch : issue504
2014-04-14 17:42:02 -04:00
holger krekel 85d52481b1 fix issue483: trial/py33 works now properly. Thanks Daniel Grana for PR. 2014-03-28 14:47:34 +01:00
holger krekel 84ab194516 add changelog: merge PR123: improved integration with mock.patch decorator on tests. 2014-03-26 19:06:56 +01:00
holger krekel 50abe43216 fix issue #479: properly handle nose/unittest(2) SkipTest exceptions
during collection/loading of test modules.  Thanks to Marc Schlaich
for the complete PR.
2014-03-14 15:44:39 +01:00
holger krekel 0836d74ae7 add Jurko to authors/contributors file 2014-01-23 15:08:24 +01:00
Anatoly Bubenkov 618bd56acf add Piotr Banaszkiewicz 2014-01-23 00:54:25 +01:00
holger krekel 7d9297e929 add changelog entry: PR90: add --color=yes|no|auto option to force terminal coloring
mode ("auto" is default).  Thanks Marc Abramowitz.
2013-12-08 20:25:36 +01:00
holger krekel 788303523e add changelog: integrate option tab-completion when argcomplete is used. Thanks
Anthon van der Neut for the PR.  This also lets pytest use argparse
instead of optparse.
2013-07-26 07:51:33 +02:00
holger krekel c53556b88d paint last line red if "failures" or "errors" occured, attribute theuni 2013-07-17 09:31:55 +02:00
holger krekel 13ddce2381 fix issue320 - fix class scope for fixtures when mixed with
module-level functions.  Thanks Anatloy Bubenkoff.
2013-07-08 15:54:38 +02:00
holger krekel 723e414814 add KAsia to authors 2013-07-06 17:17:03 +02:00
holger krekel f9720a38fe mention added support for setUpModule/tearDownModule detection, thanks Brian Okken. 2013-06-23 09:24:48 +02:00
holger krekel c294a417bd allow to specify parametrize inputs as a comma-separated string
add Wouter to changelog and to authors
2013-05-28 10:32:54 +02:00
holger krekel 8a0a18e9b3 - add Brianna (@pfctdayelise ) to changelog and contributors
- fix some broken tests on py32/py33 (related to issue308 merge)
- re-format docstrings
-
2013-05-22 15:24:58 +02:00
holger krekel 5a1ce3c45c add Jaap Broekhuizen for junitxml gen 2013-05-10 08:14:39 +02:00
holger krekel d69c9da656 add maho as contributor 2013-05-09 15:37:51 +02:00
holger krekel 51688270ac implemented as context managers. Thanks Andreas Pelme,
ladimir Keleshev.
fix issue245 by depending on the released py-1.4.14
which fixes py.io.dupfile to work with files with no
mode. Thanks Jason R. Coombs.
2013-05-07 10:53:31 +02:00
holger krekel 1884be0121 added changelog entry for getfixture() for doctests 2013-03-21 12:41:39 +01:00
holger krekel 3d79e7060e allow to specify prefixes starting with "_" when
customizing python_functions test discovery. (thanks Graham Horler)
2012-11-28 09:23:36 +01:00
holger krekel a51e52aee3 fix issue89 apply Daniel Nouri's patch to doctest/--pdb interaction. 2011-11-15 13:28:22 +00:00
holger krekel 5dfce4a0ca update authors to reflect more current situation 2011-06-01 08:00:12 +02:00
holger krekel 4a489af0ff remove the --junitxmlprefix feature - it's kind of YAGNI i guess -
i introduced it after 1.3.1 but don't need it anymore and thus
it's not going to be there for 1.3.2.

--HG--
branch : trunk
2010-07-03 14:44:47 +02:00
holger krekel 587951966f adding a logxml plugin and a --xml=path option generating a junit-xml style result log. The xml result log can be parsed nicely by hudson.
Initial code was based on Ross Lawley's pytest_xmlresult plugin.

--HG--
branch : trunk
2009-12-31 11:25:07 +01:00
holger krekel db1ff48996 * use the MIT license for the py lib
* bump version to prospective 1.1.0b1
* strike some unused code from initpkg

--HG--
branch : trunk
2009-10-03 01:11:04 +02:00
holger krekel aed66120a2 fix typo, add ronny to authors, normalize email addresses
--HG--
branch : trunk
2009-09-30 17:59:03 +02:00
holger krekel 7ab98c1b25 * delete or text files to hacking/ directory.
* split license file into authors and license file, minor fixes.
* minor unicode fixes

--HG--
branch : trunk
2009-09-05 16:09:44 +02:00