Commit Graph

3531 Commits

Author SHA1 Message Date
Piotr Banaszkiewicz ae64221c34 Contribution guide: added pull request button image 2014-01-24 20:01:04 +01:00
Piotr Banaszkiewicz 22017f11d0 Contribution guide: removed confusion regarding git 2014-01-24 19:37:44 +01:00
Piotr Banaszkiewicz c1eaad7d57 Contribution guide: added "what is pull request" section 2014-01-24 19:21:21 +01:00
holger krekel 8e6d538a57 address issue416: clarify docs as to conftest.py loading semantics 2014-01-23 15:25:01 +01:00
holger krekel 0836d74ae7 add Jurko to authors/contributors file 2014-01-23 15:08:24 +01:00
holger krekel a9e5bd52d3 remove github links 2014-01-23 14:50:58 +01:00
Anatoly Bubenkov b4b5e358c3 merge with mainline 2014-01-23 13:21:00 +01:00
Anatoly Bubenkov 4190809d1a remove the github contribution section 2014-01-23 13:19:49 +01:00
holger krekel 4e2a820c6a add Daniel Greensfeld 3-part blog series about pytest 2014-01-23 13:07:28 +01:00
holger krekel 14a43fffee have travis use the devpi index to get the pylib dependency 2014-01-23 12:18:20 +01:00
holger krekel 245d39f52d Merged in jurko/pytest/document_ExceptionInfo_ref_cycle (pull request #109)
document explicitly clearing local references to pytest.raises() results (redo of pull request #98)
2014-01-23 11:42:51 +01:00
holger krekel ac0b862f8f speak about "pytest" rather than "py.test". Thanks Jurko. 2014-01-23 11:42:20 +01:00
holger krekel c41db8ebbb refine contributing text in several places 2014-01-23 11:38:05 +01:00
Jurko Gospodnetić 75c124ea17 reword note on explicitly clearing local references to pytest.raises() results
Made it clearer that clearing such references is not mandatory and is only an
optional step which may help the Python interpreter speed up its garbage
collection.

--HG--
branch : document_ExceptionInfo_ref_cycle
2014-01-23 11:36:04 +01:00
Anatoly Bubenkov ab13c3f362 add explicit branch creation note 2014-01-23 10:51:45 +01:00
holger krekel c9af19dae1 rename, refine and link to new contributing doc from several places. 2014-01-23 10:21:06 +01:00
Jurko Gospodnetić ffffac27f9 document explicitly clearing local references to pytest.raises() results
pytest.raises() returns an ExceptionInfo object which, if a local reference is
made to it, forms a reference cycle:
  ExceptionInfo
  --> exception
  --> stack frame raising the exception
  --> current stack frame
  --> current local variables
  --> Exception Info

Such a reference cycle would then prevent any local variables in the current
stack frame, or any of its child stack frames involved in the same reference
cycle, from being garbage collected until the next reference cycle garbage
collection phase. This unnecessarily increases the program's memory footprint
and potentially slows it down.

This situation is based on a similar one described in the official 'try'
statement Python documentation for locally stored exception references.

--HG--
branch : document_ExceptionInfo_ref_cycle
2014-01-23 09:46:36 +01:00
Anatoly Bubenkov 618bd56acf add Piotr Banaszkiewicz 2014-01-23 00:54:25 +01:00
Anatoly Bubenkov 402232e60f merge pbanaszkiewicz/contributiondocs 2014-01-23 00:52:49 +01:00
holger krekel 400b51caf6 mark encoding test as xfail also on py2 2014-01-22 22:18:33 +01:00
holger krekel 9aaf0fd340 backing out Ronny's PR because it was merged too early (still has failing tests) 2014-01-22 22:15:40 +01:00
Ronny Pfannschmidt 8976b3ee0e stop exposing capsys/capfd.capture 2014-01-22 21:52:32 +01:00
Ronny Pfannschmidt ac2f2b1deb add notes on the copied pylib version 2014-01-22 21:50:07 +01:00
Ronny Pfannschmidt 0be961a0f3 capture tests: move imports and declarations to the top 2014-01-22 21:46:35 +01:00
Ronny Pfannschmidt b4a397d153 kill ancient capture devnullpath, os.devnull exists since py 2.4 2014-01-22 21:37:59 +01:00
Ronny Pfannschmidt d1a9ab3df0 small cleanp 2014-01-22 21:04:00 +01:00
Ronny Pfannschmidt 0ede968ec0 kill the str magic of Encodedfile 2014-01-22 21:03:49 +01:00
Ronny Pfannschmidt 5f21abc3a3 move imports and declarations to the top 2014-01-22 20:48:17 +01:00
Ronny Pfannschmidt e2bb81124c simplify StdCaptureFD snapshot reading 2014-01-22 19:48:10 +01:00
Ronny Pfannschmidt ea18e9656b rewrite all _pytest.capture uses of py.io to _pytest.capture 2014-01-22 19:44:20 +01:00
Ronny Pfannschmidt 3cc58c2f78 rewrite all testing uses of py.io to _pytest.capture 2014-01-22 19:32:23 +01:00
Ronny Pfannschmidt 0ac94134f5 initial code import for capture transfer 2014-01-22 19:04:38 +01:00
Ronny Pfannschmidt c142f2551d xfailing test for captire encoding issues with binary stdio 2014-01-22 18:07:54 +01:00
holger krekel cccfaa81fb fix issue413: exceptions with unicode attributes are now printed
correctly also on python2 and with pytest-xdist runs. (the fix
requires py-1.4.20)
2014-01-22 17:48:56 +01:00
Piotr Banaszkiewicz d960fb78fc Contribution guide: moved tox inst. instructions up
--HG--
branch : contributiondocs
2014-01-22 17:05:11 +01:00
holger krekel d02d0bb7b7 Merged in pelme/pytest/py2_pkg_skip (pull request #107)
fixed issue428: Skip test for packages without __init__.py on Python 2
2014-01-22 14:46:22 +01:00
Andreas Pelme fe4cdd8a90 fixed issue428: Skip test for packages without __init__.py on Python 2
--HG--
branch : py2_pkg_skip
2014-01-22 14:32:22 +01:00
Jurko Gospodnetić 54a143e6a8 add test: '--markers' listing info from plugins in current folder
When pytest is called with the '--markers' option, it should collect marker
information from the current folder, and they should get loaded and used
correctly before the '--markers' output is constructed.
2014-01-22 14:16:39 +01:00
holger krekel 3a4f69734a remove superflous line 2014-01-22 13:54:25 +01:00
Piotr Banaszkiewicz fbdc6e8cc0 Addressed contribution guide issues: virtualenv, links, Github mirror, RST rendering
--HG--
branch : contributiondocs
2014-01-22 12:19:33 +01:00
Piotr Banaszkiewicz c2c44f0ffc Moved contribution guide to the rootdir/CONTRIBUTING.txt
--HG--
branch : contributiondocs
2014-01-22 11:37:02 +01:00
Floris Bruynooghe e12fe64b54 Include py version in the terminal output
This can help to reproduce bugs when looking at the output pasted into
bug reports.
2014-01-22 11:27:15 +01:00
Piotr Banaszkiewicz 5240252164 New enthusiastic contribution guide based on Audreyr's cookiecutter-pypackage
Audrey's code is BSD, so there should be no problem with licensing.

I've covered:
* contribution types (with hints)
* steps to start with pytest development
* testing pytest
* basics of hg

--HG--
branch : contributiondocs
2014-01-22 11:24:58 +01:00
holger krekel 1ffc006363 fixed circular imports by reverting a few py.test -> pytest substitions. 2014-01-22 11:17:25 +01:00
holger krekel 836232e544 fix issue425: mention at end of "py.test -h" that --markers
and --fixtures work according to specified test path (or current dir)
2014-01-22 10:24:22 +01:00
holger krekel 2539e5a352 Merged in derdon/pytest/no-p-option (pull request #102)
added docs about the `no:` syntax for the -p option
2014-01-20 13:22:31 +01:00
Jurko Gospodnetić 8e457338ee fix handling MarkDecorators called with a single positional plus keyword args
When a MarkDecorator instance is called it does the following:
  1. If called with a single class as its only positional argument and no
     additional keyword arguments, it attaches itself to the class so it gets
     applied automatically to all test cases found in that class.
  2. If called with a single function as its only positional argument and no
     additional keyword arguments, it attaches a MarkInfo object to the
     function, containing all the arguments already stored internally in the
     MarkDecorator.
  3. When called in any other case, it performs a 'fake construction' call, i.e.
     it returns a new MarkDecorator instance with the original MarkDecorator's
     content updated with the arguments passed to this call.

When Python applies a function decorator it always passes the target class/
function to the decorator as its positional argument with no additional
positional or keyword arguments. However, when MarkDecorator was deciding
whether it was being called to decorate a target function/class (cases 1. & 2.
as documented above) or to return an updated MarkDecorator (case 3. as
documented above), it only checked that it received a single callable positional
argument and did not take into consideration whether additional keyword
arguments were being passed in as well.

With this change, it is now possible to create a pytest mark storing a function/
class parameter passed as its only positional argument and accompanied by one or
more additional keyword arguments. Before, it was only possible to do so if the
function/class parameter argument was accompanied by at least one other
positional argument.

Added a related unit test.

Updated MarkDecorator doc-string.
2014-01-20 01:27:33 +01:00
Simon Liedtke d92ee8c3c3 added docs about the `no:` syntax for the -p option
--HG--
branch : no-p-option
2014-01-19 22:05:14 +01:00
Jurko Gospodnetić 492c60c202 fix doc typo 2014-01-19 10:26:55 +01:00
holger krekel 86ef81454f fix name 2014-01-19 09:13:06 +01:00