Commit Graph

7452 Commits

Author SHA1 Message Date
Bruno Oliveira bedceaacc4
Merge pull request #3249 from a-feld/request-fixture-reference-cycle
Fix PseudoFixtureDef reference cycle.
2018-02-22 19:23:56 -03:00
Bruno Oliveira 1127d519db
Merge pull request #3254 from altendky/patch-1
Correct docs to config.pluginmanager.get_plugin()
2018-02-22 19:14:47 -03:00
Kyle Altendorf b5ac61657a
Correct docs to config.pluginmanager.get_plugin()
`getplugin()` is deprecated in favor of `get_plugin()`.

dd97c94035/_pytest/config.py (L261)
2018-02-22 13:48:59 -05:00
Allan Feldman 48548767fc Use a frozen attr class for PseudoFixtureDef. 2018-02-21 23:15:39 -08:00
Allan Feldman 7536e949b1 Add changelog entry. 2018-02-21 22:42:44 -08:00
Allan Feldman 287c003cfd Add myself to AUTHORS. 2018-02-21 22:42:44 -08:00
Allan Feldman aa53e37fa2 Add a test to expose leaked PseudoFixtureDef types. 2018-02-21 22:42:44 -08:00
Ronny Pfannschmidt dd97c94035
Merge pull request #3240 from codetriage-readme-bot/codetriage-badge
Add CodeTriage badge to pytest-dev/pytest
2018-02-22 07:38:31 +01:00
Ronny Pfannschmidt 264e455410
Merge pull request #3248 from durocher/master
Fix approx default tolerances for Decimal
2018-02-22 07:35:56 +01:00
Allan Feldman 75f11f0b65 Fix reference cycle caused by PseudoFixtureDef.
Python types have reference cycles to themselves when they are created. This is
partially caused by descriptors which get / set values from the __dict__
attribute for getattr / setattr on classes.

This is not normally an issue since types tend to remain referenced for the
lifetime of the Python process (and thus never become garbage).

However, in the case of PseudoFixtureDef, the class is generated in
_get_active_fixturedef and later discarded when pytest_fixture_setup returns.
As a result, the generated PseudoFixtureDef type becomes garbage.

This is not really a performance issue but it can lead to some problems when
making tests and assertions about garbage when using pytest.

This garbage creation problem can be rectified by returning a namedtuple
instance which is functionally the same. In the modified code, the namedtuple
is allocated / deallocated using reference counting rather than having to use
the garbage collector.
2018-02-21 21:40:54 -08:00
Bruno Oliveira 45d0a21294
Fix README because of code triage badge 2018-02-21 20:42:09 -03:00
Bruno Oliveira 147b43f832
Small changelog tweak 2018-02-21 20:31:33 -03:00
mike 6e14585ca2 Fix approx default tolerances for Decimal 2018-02-21 23:08:23 +01:00
Bruno Oliveira dae74b674e
Merge pull request #3242 from nicoddemus/delete-changelog-3.4.1
Delete changelog entries for 3.4.1 release
2018-02-21 10:38:53 -03:00
Bruno Oliveira 2a99e5dd2a Delete changelog entries for 3.4.1 release
Unfortunately due to hawkowl/towncrier#99 those news fragments were
not deleted at the time of CHANGELOG generation.
2018-02-20 23:45:21 -03:00
Bruno Oliveira 9361d48b61
Merge pull request #3239 from nicoddemus/release-3.4.1
Release 3.4.1
2018-02-20 18:08:47 -03:00
codetriage-readme-bot ebddac6a5c Add CodeTriage badge to pytest-dev/pytest
Adds a badge showing the number of people helping this repo on CodeTriage.

[![Open Source Helpers](https://www.codetriage.com/pytest-dev/pytest/badges/users.svg)](https://www.codetriage.com/pytest-dev/pytest)

## What is CodeTriage?

CodeTriage is an Open Source app that is designed to make contributing to Open Source projects easier. It works by sending subscribers a few open issues in their inbox. If subscribers get busy, there is an algorithm that backs off issue load so they do not get overwhelmed

[Read more about the CodeTriage project](https://www.codetriage.com/what).

## Why am I getting this PR?

Your project was picked by the human, @schneems. They selected it from the projects submitted to https://www.codetriage.com and hand edited the PR. How did your project get added to [CodeTriage](https://www.codetriage.com/what)? Roughly 11 months ago, [cacoze](https://github.com/cacoze) added this project to CodeTriage in order to start contributing. Since then, 32 people have subscribed to help this repo.

## What does adding a badge accomplish?

Adding a badge invites people to help contribute to your project. It also lets developers know that others are invested in the longterm success and maintainability of the project.

You can see an example of a CodeTriage badge on these popular OSS READMEs:

- [![](https://www.codetriage.com/rails/rails/badges/users.svg)](https://www.codetriage.com/rails/rails) https://github.com/rails/rails
- [![](https://www.codetriage.com/crystal-lang/crystal/badges/users.svg)](https://www.codetriage.com/crystal-lang/crystal) https://github.com/crystal-lang/crystal

## Have a question or comment?

While I am a bot, this PR was manually reviewed and monitored by a human - @schneems. My job is writing commit messages and handling PR logistics.

If you have any questions, you can reply back to this PR and they will be answered by @schneems. If you do not want a badge right now, no worries, close the PR, you will not hear from me again.

Thanks for making your project Open Source! Any feedback is greatly appreciated.
2018-02-20 10:51:51 -06:00
Bruno Oliveira b319375592 Preparing release version 3.4.1 2018-02-20 01:43:59 +00:00
Bruno Oliveira f8fdf0ae91 Add --yes to towncrier to automatically remove files 2018-02-20 01:43:20 +00:00
Bruno Oliveira 053fc118b7
Merge pull request #3199 from nicoddemus/publish-tag-3060
Implement deploying to PyPI by pushing a tag
2018-02-19 22:34:35 -03:00
Bruno Oliveira b486e1294b
Merge pull request #3222 from The-Compiler/match-msg
Remove "matching '...'" part from the pytest.raises message
2018-02-17 21:18:05 -02:00
Bruno Oliveira 9d879bee36
Merge pull request #3215 from pytest-dev/bugfix/985/disable-output-capturing-in-doctest
Disable output capturing in doctest
2018-02-17 18:39:32 -02:00
Jason R. Coombs 4131d3f300 Probably it's best to write the err stream to stderr. 2018-02-17 12:13:33 -05:00
Jason R. Coombs 254e357076 Correct the broken indentation. 2018-02-17 12:10:29 -05:00
Bruno Oliveira 0f6879bf5e
Small update to changelog/README.rst 2018-02-17 10:20:41 -02:00
Bruno Oliveira bfe2cbe875 Implement publishing to PyPI by pushing a tag
Fix #3060
2018-02-17 10:13:25 -02:00
Bruno Oliveira 00d3001138
Merge pull request #3188 from s0undt3ch/issues/3184
Don't traceback on unkown sections.
2018-02-17 09:02:44 -02:00
Bruno Oliveira 6bc45d158d
Merge pull request #3186 from brianmaissy/bugfix/print_captured_stdout_before_entering_pdb
Added printing of captured stdout before entering pdb
2018-02-15 19:38:23 -02:00
Bruno Oliveira 371eb8c6af
Merge pull request #3206 from mbachry/fix-unittest-mock
Fix mock patchings detection when both mock and unittest.mock are present
2018-02-15 19:35:44 -02:00
Jason R. Coombs 435b8ddc7c
Rename method for additional clarity. 2018-02-15 09:17:33 -05:00
Florian Bruhin 3cbf0c8ec0 Raise unexpected exceptions with pytest.raises() using match= 2018-02-15 12:11:56 +01:00
Florian Bruhin 9849022eb2 Remove "matching '...'" part from the pytest.raises message
When a test with pytest.raises(ValueError, match='foo') doesn't raise, the
following error is printed:

    Failed: DID NOT RAISE <class 'ValueError'> matching 'foo'

This error message is confusing as it implies a ValueError was raised, but the
message wasn't matching 'foo'.

I first considered rewording it somehow to preserve the match pattern in it, but
I don't think that's worthwhile as the pattern should usually be apparent from
the stacktrace anyways (hard-coded, as parametrization, or with --showlocals for
more sophisticated cases).
2018-02-14 19:20:00 +01:00
Jason R. Coombs 18c84a1904 Restrict fix to macOS only. Ref #3215. 2018-02-13 17:51:20 -05:00
Jason R. Coombs 247cdb835a Remove xfail; tests now pass on macOS. Ref #985. 2018-02-13 12:41:19 -05:00
Jason R. Coombs ce1872e7e8 Merge branch 'master' into bugfix/985/disable-output-capturing-in-doctest 2018-02-13 12:33:07 -05:00
Jason R. Coombs d845af7b24 Add changelog. Ref #985. 2018-02-13 12:32:00 -05:00
Jason R. Coombs 391553887b Disable output capturing in doctest to avoid losing reference to stdout. Fixes #985. 2018-02-13 12:08:39 -05:00
Brian Maissy 7656fc8320 Added printing of captured stdout and stderr before entering pdb 2018-02-12 23:17:51 +02:00
Marcin Bachry b6166dccb4 Fix mock patchings detection when both mock and unittest.mock are present 2018-02-12 20:29:37 +01:00
Bruno Oliveira e7bcc854d9
Merge pull request #3202 from rouge8/pytest-raises-sphinx-parameters
Add Sphinx parameter docs for `match` and `message` args to `pytest.raises()`
2018-02-10 02:32:56 -02:00
Bruno Oliveira ffee213c85
Update and rename 3202.trivial.rst to 3202.doc.rst 2018-02-09 22:51:15 -02:00
Andy Freeland e5b527d0e3 Add Sphinx parameter docs for `match` and `message` args to `pytest.raises()` 2018-02-09 16:28:17 -08:00
Bruno Oliveira c04e248de5
Rename 3161.bugfix to 3161.bugfix.rst 2018-02-09 14:06:24 -02:00
Florian Bruhin 3685c1bc01
Merge pull request #3192 from nicoddemus/pr-template
Add changelog/README.rst and streamline our PR template text
2018-02-08 19:20:54 +01:00
Bruno Oliveira eea169e515 Code review suggestions 2018-02-08 08:03:14 -02:00
Bruno Oliveira 16c52f05f1
Merge pull request #3177 from nicoddemus/mention-force-result
Mention outcome.force_result() and add link to pluggy's docs
2018-02-07 18:16:16 -02:00
Bruno Oliveira f72182977d
Merge pull request #3183 from cheezman34/master
Fix ordering of tests to minimize fixture creating
2018-02-07 18:15:41 -02:00
Bruno Oliveira 40d0ade2d9 Add changelog/README.rst and streamline our PR template text
This streamlines the PR template text and adds a more in-depth explanation
about how the changelog entries work because this topic is a common source of
confusion:

- How to name the files.
- Which formatting to use (people in general assume it is Markdown).
- Recommend adding `.rst` extension to changelog files to help with the
  above (`towncrier` doesn't care).

This was heavily inspired by the excellent python-trio/trio docs.
2018-02-06 22:20:39 -02:00
Bruno Oliveira 7152707280
Update changelog entry to "trivial" as it is a temporary workaround
I think this is a more appropriate category given that the underlying problem still exists
2018-02-06 08:54:44 -02:00
Bruno Oliveira 42c1f85257
Update CHANGELOG 2018-02-05 20:07:42 -02:00