Commit Graph

473 Commits

Author SHA1 Message Date
Ronny Pfannschmidt 6be57a3711 move python api helpers out of the python module
this separates exposed normal api from collection elements
2017-06-11 12:27:16 +02:00
Ronny Pfannschmidt 36251e0db4 move approx to own file 2017-06-11 12:15:30 +02: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
Bruno Oliveira 58ac4faf0c Fix exception formatting while importing test modules
Fix #2336
2017-03-29 14:43:13 -03:00
Ronny Pfannschmidt 6165939b0d fix rebase mistakes 2017-03-28 11:45:06 +02:00
Ronny Pfannschmidt 7cdefce656 fix up oversights 2017-03-28 11:45:06 +02:00
Ronny Pfannschmidt 92f6ab1881 fix all singular internal module imports and add a test for them 2017-03-28 11:45:06 +02:00
Ronny Pfannschmidt ae234786ea remove pytest_namespace from _pytest.python 2017-03-28 11:45:06 +02:00
Bruno Oliveira fa56114115 Clean up warnings generated by pytest's own suite 2017-03-20 22:13:17 -03:00
Ronny Pfannschmidt e368fb4b29 implement pytest.param
this allows a clear addition of parameterization parameters that carry along marks
instead of nesting multiple mark objects and destroying the possibility of creating
function valued parameters,
it just folders everything together into one object carrfying parameters, and the marks.
2017-03-17 16:53:43 +01: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
Ville Skyttä ede4e9171f Spelling fixes 2017-02-15 17:00:58 +02:00
Thomas Kriechbaumer 43662ce789 allow error message matching in pytest.raises 2017-02-02 19:52:33 +01:00
Bruno Oliveira e1c5314d80 Replace 'raise StopIteration' usages in the code by 'return's in accordance to PEP-479
Fix #2160
2017-02-01 02:37:55 -02:00
Ravi Chandra c848d0a771 Pass parameter name to `make_parametrize_id` hook function 2017-01-21 16:46:45 +13:00
Rafael Bertoldi a9193a1531 No longer silently ignore errors in parametrize callable ids 2017-01-02 17:26:17 -02:00
Bruno Oliveira 402fbe503a Merge branch 'master' into merge-master-into-features 2016-12-27 23:31:26 -02:00
Bruno Oliveira 57c4489916 Use a simple ``+-`` ASCII string in the string representation of pytest.approx In Python 2
Fix #2111
2016-12-02 20:01:53 -02:00
Luke Murphy f5afd8cb54 Add missing `__test__` check for test discovery. 2016-11-30 17:05:42 +01:00
Bruno Oliveira b30a6d22c5 Merge branch 'master' into merge-master-into-features 2016-11-27 17:30:40 -02:00
Bruno Oliveira 33c0b06fdf Fix error in approx's repr with complex numbers
Fix #2082
2016-11-24 15:33:12 -02:00
Bruno Oliveira 5ce551e469 Merge pull request #2075 from pytest-dev/master
Merge master into features after fixing flake8 errors
2016-11-22 14:10:31 -02:00
Bruno Oliveira 1eb5a690d4 Fix flake8 E305 and E306 errors
These errors started to appear with flake8-3.1.1, while they don't appear with
version 3.1.0 (weird).
2016-11-20 18:59:15 -02:00
Bruno Oliveira efc54b2e56 Merge branch 'master' into merge-master-features 2016-11-11 18:56:53 -02:00
Bruno Oliveira 1130b9f742 Fix the stubborn test about cyclic references left by pytest.raises
In Python 2, a context manager's __exit__() leaves sys.exc_info with the exception values even when it was supposed
to suppress the exception, so we explicitly call sys.exc_clear() which removes the traceback and allow the object
to be released.

Also updated the test to not depend on the immediate destruction of the object but instead to ensure it is not being
tracked as a cyclic reference.

Fix #1965
2016-11-08 22:20:27 -02:00
Bruno Oliveira 37dcdfbc58 Re-enable docstring testing of _pytest modules on CI
* Fix doctests
* List one env per line in tox.ini
* "doctesting" tox env now also tests docstrings using doctest
2016-10-21 08:55:53 -02:00
Bruno Oliveira 9d00615bbf Merge remote-tracking branch 'upstream/master' into merge-master-into-features 2016-10-20 21:51:42 -02:00
Bruno Oliveira a1d446b8e8 Display traceback from Import errors using pytest's short representation
Also omit pytest's own modules and internal libraries (py and pluggy) in low verbosity

Fix #1976
2016-10-03 21:46:44 -03:00
Bruno Oliveira 7d66e4eae1 Display full traceback from Import errors when collecting test modules
Fix #1976
2016-10-03 20:47:44 -03:00
Nikolaus Rath 57bb3c6922 Improve error message when using pytest.skip at module level
As discussed in issue #1959.
2016-10-01 13:38:52 -03:00
Bruno Oliveira 654af0ba25 Merge remote-tracking branch 'upstream/master' into features 2016-09-26 19:32:53 -03:00
Bruno Oliveira e5deb8a927 Merge pull request #1955 from rowillia/fix_python3_deprecation_warnings
Fix `DeprecationWarnings` found when running py.test in Python 2.7 with the -3 flag.
2016-09-22 17:37:52 -03:00
Roy Williams 24db3c123d Explicitly set to None to have consistent behavior in Python 2 and Python 3 2016-09-22 09:22:12 -07:00
Roy Williams 940ed7e943 Fix `DeprecationWarnings` found when running py.test in Python 2.7 with the -3 flag.
Running through some of my tests with the `-3` flag in python2.7 I encountered some errors within py.test itself.  This fixes those errors so we can use py.test in order to identify problems with Python 3.
2016-09-21 17:44:25 -07:00
Tyler Goodlet 6db2f315fa Explain a bad scope value to the user 2016-09-21 16:40:58 -04:00
Lev Maximov 65be1231b1 AttributeError chaining bug #1944 fix 2016-09-20 02:20:13 +07:00
Floris Bruynooghe 5b260d80f9 Merge pull request #1883 from RonnyPfannschmidt/kill-memoized-call
Kill memoized call
2016-09-19 12:47:52 +01:00
Ronny Pfannschmidt 1c9bd9278e Merge pull request #1913 from flub/builtin-assertion
Remove BuiltinAssertionError
2016-09-05 16:53:13 +02:00
Floris Bruynooghe 28b1896e9a Remove BuiltinAssertionError
We used to have this when we where patching the real Python
AssertionError for use with reinterpret, but reinterpret is now
gone so we no longer need this as it is not used by rewrite.
2016-09-05 15:29:09 +02:00
Ronny Pfannschmidt e572c16d3f remove memoizedcall in Module 2016-09-05 14:41:28 +02:00
Bruno Oliveira 1e10de574d The "ids" argument to "parametrize" again accepts unicode strings in Python 2
Fixes #1905
2016-09-02 18:38:15 -03:00
Bruno Oliveira 519f02b014 docs warnings as errors and initial page similar to README
* Changed "index" to be more similar to the README (#1708).
* Fixes numerous issues like missing documents, syntax errors, etc (#1829, #432).
* Mention all docs in "contents.rst" so it's easier for users to locate (#1112).
* Add doc generation and checking to Travis and AppVeyor, to avoid re-introducing errors.

Fixes #432, Fixes #1112, Fixes #1708, Fixes #1829
2016-08-26 17:47:18 -03:00
Bruno Oliveira 972a5fb5d5 Improve error message when passing non-string ids to pytest.mark.parametrize
Fix #1857
2016-08-23 23:31:45 -03:00
Bruno Oliveira df200297e2 Fix internal error when parametrizing using and empty list of ids()
Fix #1849
2016-08-23 18:18:46 -03:00
Bruno Oliveira 53a0e2b118 Fix code which guesses parametrized scope based on arguments
Fix #1832
2016-08-22 21:05:41 -03:00
Ronny Pfannschmidt 406777d104 mark plugin: move the unclean marked parameter extraction 2016-08-21 20:44:37 +02:00
Florian Bruhin a20c3f9c44 Merge pull request #1827 from blueyed/Fix-spelling-s-outside-a-outside-of-a-
Fix spelling: s/outside a/outside of a/
2016-08-20 20:04:58 +02:00