Skip to content

merge master into features #2222

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 49 commits into from
Jan 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
9c285df
fix #2118 - rework Node._getcustomclass and Node compat properties
RonnyPfannschmidt Dec 6, 2016
03a7a2c
Fix typos
jwilk Dec 31, 2016
78f0388
Merge pull request #2168 from jwilk/spelling
nicoddemus Jan 1, 2017
ef90346
Fix broken links
pfheatwole Jan 2, 2017
b769e41
Merge pull request #2170 from gogoengie/broken-links
nicoddemus Jan 2, 2017
6d81c68
Switch monkeypatch fixture to yield syntax
jeffwidman Jan 4, 2017
9477f59
Merge pull request #2173 from jeffwidman/patch-1
nicoddemus Jan 5, 2017
7559400
Add py36 to test on AppVeyor
nicoddemus Jan 5, 2017
64cb67b
Merge pull request #2174 from nicoddemus/appveyor-py36
nicoddemus Jan 6, 2017
aa82db9
Ensure the LICENSE is included in built wheels
pombredanne Jan 10, 2017
ff309b3
Merge pull request #2182 from pombredanne/patch-1
RonnyPfannschmidt Jan 10, 2017
e18b2a4
Fail assert_outcomes() on missing terminal report
Jan 11, 2017
043aade
Consider plugins loaded by PYTEST_PLUGINS for assertion rewrite
nicoddemus Jan 11, 2017
7cd7c28
Refactor plugin specs handling into an isolated function
nicoddemus Jan 12, 2017
3dfdbaf
Merge pull request #2186 from nicoddemus/pytest-plugins-env-rewrite
nicoddemus Jan 13, 2017
46a9861
Remove mention of --assert=reinterp in documentation
rjprins Jan 13, 2017
125e89b
Merge pull request #2194 from rjprins/remove-reinterp-from-docs
RonnyPfannschmidt Jan 14, 2017
61fa91f
Fix marker example on "linux" platform
nicoddemus Jan 17, 2017
d15724f
Merge pull request #2204 from nicoddemus/linux-marker-doc
RonnyPfannschmidt Jan 18, 2017
2574da8
Fix pytester internal plugin to work correctly with latest versions o…
nicoddemus Jan 19, 2017
c477f09
Assert statements of the pytester plugin again benefit from assertion…
nicoddemus Jan 19, 2017
7b4368f
Merge pull request #2184 from eli-b/parseoutcomes-explicit-failure
nicoddemus Jan 19, 2017
e0c48b4
Merge pull request #2212 from nicoddemus/pytester-rewrite
RonnyPfannschmidt Jan 20, 2017
4082f40
comment out compatproperty deprecations
RonnyPfannschmidt Jan 20, 2017
3766060
Merge branch 'master' into trial-envs
nicoddemus Jan 20, 2017
1a2d638
Merge pull request #2211 from nicoddemus/trial-envs
RonnyPfannschmidt Jan 20, 2017
7b4afd8
remove unused import
RonnyPfannschmidt Jan 20, 2017
6a96b46
update changelog as suggested
RonnyPfannschmidt Jan 20, 2017
15a3b57
Merge pull request #2120 from RonnyPfannschmidt/fix-2118
nicoddemus Jan 20, 2017
4031222
fix devpi test for doctesting env
RonnyPfannschmidt Jan 22, 2017
c39d846
Merge pull request #2215 from RonnyPfannschmidt/fix-doctesting/devpi-bug
nicoddemus Jan 22, 2017
55f21bd
bump version
RonnyPfannschmidt Jan 20, 2017
4d0c635
regendoc
RonnyPfannschmidt Jan 20, 2017
01eaf9d
fix the xfail docstring typo at the actual docstring + regendoc
RonnyPfannschmidt Jan 20, 2017
34b898b
generate the release announcement
RonnyPfannschmidt Jan 20, 2017
449b88c
rerun regendoc with correct install
RonnyPfannschmidt Jan 20, 2017
22da561
fix copy+paste error, its supposed to be 3.0.6
RonnyPfannschmidt Jan 20, 2017
0e64cd0
take off author_email after pypi rejects
RonnyPfannschmidt Jan 22, 2017
c9f327d
bump version to next dev
RonnyPfannschmidt Jan 22, 2017
400b077
Merge pull request #2213 from RonnyPfannschmidt/release-3.0.6
RonnyPfannschmidt Jan 22, 2017
839aa96
Add py36 identifier
vmuriart Jan 22, 2017
902fd2f
Add py37-nightly to travis
vmuriart Jan 23, 2017
d076e41
Merge pull request #2216 from vmuriart/patch-1
RonnyPfannschmidt Jan 23, 2017
beb77c1
Fix release date for 3.0.6
nicoddemus Jan 23, 2017
d98d122
Discourage users from using this all the time.
ionelmc Jan 25, 2017
c8032a9
Fix reference.
ionelmc Jan 25, 2017
0931fe2
Merge pull request #2221 from pytest-dev/ionelmc-patch-1
nicoddemus Jan 25, 2017
713bdc1
merge master into features
RonnyPfannschmidt Jan 26, 2017
3f30c22
fix changelog merge mistake
RonnyPfannschmidt Jan 26, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,11 @@ env:
- TESTENV=docs

matrix:
allow_failures:
# see #1989
- env: TESTENV=py27-trial
- env: TESTENV=py35-trial
include:
- env: TESTENV=py36
python: '3.6-dev'
- env: TESTENV=py37
python: 'nightly'

script: tox --recreate -e $TESTENV

Expand Down
3 changes: 3 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ Duncan Betts
Edison Gustavo Muenz
Edoardo Batini
Eduardo Schettino
Eli Boyarski
Elizaveta Shashkova
Endre Galaczi
Eric Hunsberger
Expand All @@ -71,6 +72,7 @@ Janne Vanhala
Jason R. Coombs
Javier Domingo Cansino
Javier Romero
Jeff Widman
John Towler
Jon Sonesen
Jordan Guymon
Expand Down Expand Up @@ -141,6 +143,7 @@ Tom Viner
Trevor Bekolay
Tyler Goodlet
Vasily Kuznetsov
Victor Uriarte
Vlad Dragos
Wouter van Ackooy
Xuecong Liao
88 changes: 60 additions & 28 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ Changes
.. _@mattduck: https://github.com/mattduck
.. _@wheerd: https://github.com/wheerd
.. _@fogo: https://github.com/fogo
.. _@lesteve: https://github.com/lesteve
.. _@mandeep: https://github.com/mandeep

.. _#1512: https://github.com/pytest-dev/pytest/issues/1512
Expand All @@ -58,30 +57,63 @@ Changes
.. _#2166: https://github.com/pytest-dev/pytest/pull/2166
.. _#2147: https://github.com/pytest-dev/pytest/issues/2147

3.0.6.dev0 (unreleased)
3.0.7 (unreleased)
=======================

*

*

*

*


3.0.6 (2017-01-22)
==================

* pytest no longer generates ``PendingDeprecationWarning`` from its own operations, which was introduced by mistake in version ``3.0.5`` (`#2118`_).
Thanks to `@nicoddemus`_ for the report and `@RonnyPfannschmidt`_ for the PR.


* pytest no longer recognizes coroutine functions as yield tests (`#2129`_).
Thanks to `@malinoff`_ for the PR.

* Plugins loaded by the ``PYTEST_PLUGINS`` environment variable are now automatically
considered for assertion rewriting (`#2185`_).
Thanks `@nicoddemus`_ for the PR.

* Improve error message when pytest.warns fails (`#2150`_). The type(s) of the
expected warnings and the list of caught warnings is added to the
error message. Thanks `@lesteve`_ for the PR.

* Fix ``pytester`` internal plugin to work correctly with latest versions of
``zope.interface`` (`#1989`_). Thanks `@nicoddemus`_ for the PR.

* Assert statements of the ``pytester`` plugin again benefit from assertion rewriting (`#1920`_).
Thanks `@RonnyPfannschmidt`_ for the report and `@nicoddemus`_ for the PR.

* Specifying tests with colons like ``test_foo.py::test_bar`` for tests in
subdirectories with ini configuration files now uses the correct ini file
(`#2148`_). Thanks `@pelme`_.

*
* Fail ``testdir.runpytest().assert_outcomes()`` explicitly if the pytest
terminal output it relies on is missing. Thanks to `@eli-b`_ for the PR.


.. _@lesteve: https://github.com/lesteve
.. _@malinoff: https://github.com/malinoff
.. _@pelme: https://github.com/pelme
.. _@eli-b: https://github.com/eli-b

.. _#2118: https://github.com/pytest-dev/pytest/issues/2118

.. _#1989: https://github.com/pytest-dev/pytest/issues/1989
.. _#1920: https://github.com/pytest-dev/pytest/issues/1920
.. _#2129: https://github.com/pytest-dev/pytest/issues/2129
.. _#2148: https://github.com/pytest-dev/pytest/issues/2148
.. _#2150: https://github.com/pytest-dev/pytest/issues/2150
.. _#2185: https://github.com/pytest-dev/pytest/issues/2185


3.0.5 (2016-12-05)
Expand Down Expand Up @@ -751,7 +783,7 @@ time or change existing behaviors in order to make them less surprising/more use
Thanks `@astraw38`_ for reporting the issue (`#1496`_) and `@tomviner`_
for PR the (`#1524`_).

* Fix win32 path issue when puttinging custom config file with absolute path
* Fix win32 path issue when putting custom config file with absolute path
in ``pytest.main("-c your_absolute_path")``.

* Fix maximum recursion depth detection when raised error class is not aware
Expand Down Expand Up @@ -1083,7 +1115,7 @@ time or change existing behaviors in order to make them less surprising/more use

- (experimental) adapt more SEMVER style versioning and change meaning of
master branch in git repo: "master" branch now keeps the bugfixes, changes
aimed for micro releases. "features" branch will only be be released
aimed for micro releases. "features" branch will only be released
with minor or major pytest releases.

- Fix issue #766 by removing documentation references to distutils.
Expand Down Expand Up @@ -1217,7 +1249,7 @@ time or change existing behaviors in order to make them less surprising/more use

- new option ``--import-mode`` to allow to change test module importing
behaviour to append to sys.path instead of prepending. This better allows
to run test modules against installated versions of a package even if the
to run test modules against installed versions of a package even if the
package under test has the same import root. In this example::

testing/__init__.py
Expand Down Expand Up @@ -1375,7 +1407,7 @@ time or change existing behaviors in order to make them less surprising/more use
explanations. Thanks Carl Meyer for the report and test case.

- fix issue553: properly handling inspect.getsourcelines failures in
FixtureLookupError which would lead to to an internal error,
FixtureLookupError which would lead to an internal error,
obfuscating the original problem. Thanks talljosh for initial
diagnose/patch and Bruno Oliveira for final patch.

Expand Down Expand Up @@ -1518,7 +1550,7 @@ time or change existing behaviors in order to make them less surprising/more use

- fix conftest related fixture visibility issue: when running with a
CWD outside of a test package pytest would get fixture discovery wrong.
Thanks to Wolfgang Schnerring for figuring out a reproducable example.
Thanks to Wolfgang Schnerring for figuring out a reproducible example.

- Introduce pytest_enter_pdb hook (needed e.g. by pytest_timeout to cancel the
timeout when interactively entering pdb). Thanks Wolfgang Schnerring.
Expand Down Expand Up @@ -1717,7 +1749,7 @@ time or change existing behaviors in order to make them less surprising/more use
- fix issue429: comparing byte strings with non-ascii chars in assert
expressions now work better. Thanks Floris Bruynooghe.

- make capfd/capsys.capture private, its unused and shouldnt be exposed
- make capfd/capsys.capture private, its unused and shouldn't be exposed


2.5.1 (2013-12-17)
Expand Down Expand Up @@ -1774,7 +1806,7 @@ time or change existing behaviors in order to make them less surprising/more use
to problems for more than >966 non-function scoped parameters).

- fix issue290 - there is preliminary support now for parametrizing
with repeated same values (sometimes useful to to test if calling
with repeated same values (sometimes useful to test if calling
a second time works as with the first time).

- close issue240 - document precisely how pytest module importing
Expand Down Expand Up @@ -1988,7 +2020,7 @@ new features:

- fix issue322: tearDownClass is not run if setUpClass failed. Thanks
Mathieu Agopian for the initial fix. Also make all of pytest/nose
finalizer mimick the same generic behaviour: if a setupX exists and
finalizer mimic the same generic behaviour: if a setupX exists and
fails, don't run teardownX. This internally introduces a new method
"node.addfinalizer()" helper which can only be called during the setup
phase of a node.
Expand Down Expand Up @@ -2107,11 +2139,11 @@ Bug fixes:
(thanks Adam Goucher)

- Issue 265 - integrate nose setup/teardown with setupstate
so it doesnt try to teardown if it did not setup
so it doesn't try to teardown if it did not setup

- issue 271 - dont write junitxml on slave nodes
- issue 271 - don't write junitxml on slave nodes

- Issue 274 - dont try to show full doctest example
- Issue 274 - don't try to show full doctest example
when doctest does not know the example location

- issue 280 - disable assertion rewriting on buggy CPython 2.6.0
Expand Down Expand Up @@ -2147,7 +2179,7 @@ Bug fixes:
- allow to specify prefixes starting with "_" when
customizing python_functions test discovery. (thanks Graham Horler)

- improve PYTEST_DEBUG tracing output by puting
- improve PYTEST_DEBUG tracing output by putting
extra data on a new lines with additional indent

- ensure OutcomeExceptions like skip/fail have initialized exception attributes
Expand Down Expand Up @@ -2196,7 +2228,7 @@ Bug fixes:
- fix issue209 - reintroduce python2.4 support by depending on newer
pylib which re-introduced statement-finding for pre-AST interpreters

- nose support: only call setup if its a callable, thanks Andrew
- nose support: only call setup if it's a callable, thanks Andrew
Taumoefolau

- fix issue219 - add py2.4-3.3 classifiers to TROVE list
Expand Down Expand Up @@ -2292,7 +2324,7 @@ Bug fixes:

- fix issue128: show captured output when capsys/capfd are used

- fix issue179: propperly show the dependency chain of factories
- fix issue179: properly show the dependency chain of factories

- pluginmanager.register(...) now raises ValueError if the
plugin has been already registered or the name is taken
Expand Down Expand Up @@ -2333,7 +2365,7 @@ Bug fixes:

- don't show deselected reason line if there is none

- py.test -vv will show all of assert comparisations instead of truncating
- py.test -vv will show all of assert comparisons instead of truncating

2.2.4 (2012-05-22)
==================
Expand All @@ -2344,7 +2376,7 @@ Bug fixes:
- fix issue with unittest: now @unittest.expectedFailure markers should
be processed correctly (you can also use @pytest.mark markers)
- document integration with the extended distribute/setuptools test commands
- fix issue 140: propperly get the real functions
- fix issue 140: properly get the real functions
of bound classmethods for setup/teardown_class
- fix issue #141: switch from the deceased paste.pocoo.org to bpaste.net
- fix issue #143: call unconfigure/sessionfinish always when
Expand All @@ -2355,7 +2387,7 @@ Bug fixes:
2.2.3 (2012-02-05)
==================

- fix uploaded package to only include neccesary files
- fix uploaded package to only include necessary files

2.2.2 (2012-02-05)
==================
Expand Down Expand Up @@ -2496,7 +2528,7 @@ Bug fixes:
- don't require zlib (and other libs) for genscript plugin without
--genscript actually being used.

- speed up skips (by not doing a full traceback represenation
- speed up skips (by not doing a full traceback representation
internally)

- fix issue37: avoid invalid characters in junitxml's output
Expand Down Expand Up @@ -2544,9 +2576,9 @@ Bug fixes:
this.

- fixed typos in the docs (thanks Victor Garcia, Brianna Laugher) and particular
thanks to Laura Creighton who also revieved parts of the documentation.
thanks to Laura Creighton who also reviewed parts of the documentation.

- fix slighly wrong output of verbose progress reporting for classes
- fix slightly wrong output of verbose progress reporting for classes
(thanks Amaury)

- more precise (avoiding of) deprecation warnings for node.Class|Function accesses
Expand Down Expand Up @@ -2607,7 +2639,7 @@ Bug fixes:

- pytest-2.0 is now its own package and depends on pylib-2.0
- new ability: python -m pytest / python -m pytest.main ability
- new python invcation: pytest.main(args, plugins) to load
- new python invocation: pytest.main(args, plugins) to load
some custom plugins early.
- try harder to run unittest test suites in a more compatible manner
by deferring setup/teardown semantics to the unittest package.
Expand Down Expand Up @@ -2846,7 +2878,7 @@ Bug fixes:
- extend and refine xfail mechanism:
``@py.test.mark.xfail(run=False)`` do not run the decorated test
``@py.test.mark.xfail(reason="...")`` prints the reason string in xfail summaries
specifiying ``--runxfail`` on command line virtually ignores xfail markers
specifying ``--runxfail`` on command line virtually ignores xfail markers

- expose (previously internal) commonly useful methods:
py.io.get_terminal_with() -> return terminal width
Expand Down Expand Up @@ -3071,7 +3103,7 @@ Bug fixes:

* add the ability to specify a path for py.lookup to search in

* fix a funcarg cached_setup bug probably only occuring
* fix a funcarg cached_setup bug probably only occurring
in distributed testing and "module" scope with teardown.

* many fixes and changes for making the code base python3 compatible,
Expand Down Expand Up @@ -3337,10 +3369,10 @@ serve as a reference for developers.
* fixed issue with 2.5 type representations in py.test [45483, 45484]
* made that internal reporting issues displaying is done atomically in py.test
[45518]
* made that non-existing files are igored by the py.lookup script [45519]
* made that non-existing files are ignored by the py.lookup script [45519]
* improved exception name creation in py.test [45535]
* made that less threads are used in execnet [merge in 45539]
* removed lock required for atomical reporting issue displaying in py.test
* removed lock required for atomic reporting issue displaying in py.test
[45545]
* removed globals from execnet [45541, 45547]
* refactored cleanup mechanics, made that setDaemon is set to 1 to make atexit
Expand Down
35 changes: 24 additions & 11 deletions _pytest/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,31 +402,26 @@ def consider_env(self):
self._import_plugin_specs(os.environ.get("PYTEST_PLUGINS"))

def consider_module(self, mod):
plugins = getattr(mod, 'pytest_plugins', [])
if isinstance(plugins, str):
plugins = [plugins]
self.rewrite_hook.mark_rewrite(*plugins)
self._import_plugin_specs(plugins)
self._import_plugin_specs(getattr(mod, 'pytest_plugins', []))

def _import_plugin_specs(self, spec):
if spec:
if isinstance(spec, str):
spec = spec.split(",")
for import_spec in spec:
self.import_plugin(import_spec)
plugins = _get_plugin_specs_as_list(spec)
for import_spec in plugins:
self.import_plugin(import_spec)

def import_plugin(self, modname):
# most often modname refers to builtin modules, e.g. "pytester",
# "terminal" or "capture". Those plugins are registered under their
# basename for historic purposes but must be imported with the
# _pytest prefix.
assert isinstance(modname, str)
assert isinstance(modname, str), "module name as string required, got %r" % modname
if self.get_plugin(modname) is not None:
return
if modname in builtin_plugins:
importspec = "_pytest." + modname
else:
importspec = modname
self.rewrite_hook.mark_rewrite(importspec)
try:
__import__(importspec)
except ImportError as e:
Expand All @@ -447,6 +442,24 @@ def import_plugin(self, modname):
self.consider_module(mod)


def _get_plugin_specs_as_list(specs):
"""
Parses a list of "plugin specs" and returns a list of plugin names.

Plugin specs can be given as a list of strings separated by "," or already as a list/tuple in
which case it is returned as a list. Specs can also be `None` in which case an
empty list is returned.
"""
if specs is not None:
if isinstance(specs, str):
specs = specs.split(',') if specs else []
if not isinstance(specs, (list, tuple)):
raise UsageError("Plugin specs must be a ','-separated string or a "
"list/tuple of strings for plugin names. Given: %r" % specs)
return list(specs)
return []


class Parser(object):
""" Parser for command line arguments and ini-file values.

Expand Down
Loading