[Pytest-commit] commit/pytest: hpk42: bump version, some windows test fixes, prevent logging from raising exceptions at the end (finally), add py25 to tox.ini.
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Mon Sep 30 16:51:45 CEST 2013
1 new commit in pytest:
https://bitbucket.org/hpk42/pytest/commits/cbeecb03918a/
Changeset: cbeecb03918a
User: hpk42
Date: 2013-09-30 16:09:26
Summary: bump version, some windows test fixes, prevent logging from raising exceptions at the end (finally), add py25 to tox.ini.
Affected #: 7 files
diff -r 6a3d8793bf5fe8f9be829bddb8bf1e95ee183323 -r cbeecb03918ab64f80f31af81c65a78799efe443 CHANGELOG
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -14,22 +14,23 @@
- the pytest_plugin_unregister hook wasn't ever properly called
and there is no known implementation of the hook - so it got removed.
-- pytest.fixture-decorated functions cannot be generators (i.e. use yield) anymore.
- This change might be reversed in 2.4.1 if it causes unforeseen real-life issues.
- However, you can always write and return an inner function/generator
- and change the fixture consumer to iterate over the returned generator.
- This change was done in lieu of the new ``pytest.yield_fixture`` decorator, see below.
+- pytest.fixture-decorated functions cannot be generators (i.e. use
+ yield) anymore. This change might be reversed in 2.4.1 if it causes
+ unforeseen real-life issues. However, you can always write and return
+ an inner function/generator and change the fixture consumer to iterate
+ over the returned generator. This change was done in lieu of the new
+ ``pytest.yield_fixture`` decorator, see below.
new features:
-- experimentally introduce a new ``pytest.yield_fixture`` decorator which
- accepts exactly the same parameters as pytest.fixture but mandates
- a ``yield`` statement instead of a ``return statement`` from fixture functions.
- This allows direct integration with "with-style" context managers
- in fixture functions and generally avoids registering of finalization callbacks
- in favour of treating the "after-yield" as teardown code.
- Thanks Andreas Pelme, Vladimir Keleshev, Floris Bruynooghe, Ronny Pfannschmidt
- and many others for discussions.
+- experimentally introduce a new ``pytest.yield_fixture`` decorator
+ which accepts exactly the same parameters as pytest.fixture but
+ mandates a ``yield`` statement instead of a ``return statement`` from
+ fixture functions. This allows direct integration with "with-style"
+ context managers in fixture functions and generally avoids registering
+ of finalization callbacks in favour of treating the "after-yield" as
+ teardown code. Thanks Andreas Pelme, Vladimir Keleshev, Floris
+ Bruynooghe, Ronny Pfannschmidt and many others for discussions.
- allow boolean expression directly with skipif/xfail
if a "reason" is also specified. Rework skipping documentation
@@ -37,11 +38,12 @@
when importing markers between modules. Specifying conditions
as strings will remain fully supported.
-- reporting: color the last line red or green depending if failures/errors occured
- or everything passed. thanks Christian Theunert.
+- reporting: color the last line red or green depending if
+ failures/errors occured or everything passed. thanks Christian
+ Theunert.
-- make "import pdb ; pdb.set_trace()" work natively wrt capturing (no "-s" needed
- anymore), making ``pytest.set_trace()`` a mere shortcut.
+- make "import pdb ; pdb.set_trace()" work natively wrt capturing (no
+ "-s" needed anymore), making ``pytest.set_trace()`` a mere shortcut.
- fix issue181: --pdb now also works on collect errors (and
on internal errors) . This was implemented by a slight internal
@@ -59,13 +61,14 @@
will replace the "get" function of the "requests" module with ``myfunc``.
- 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 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.
+ Mathieu Agopian for the initial fix. Also make all of pytest/nose
+ finalizer mimick 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.
-- simplify pytest.mark.parametrize() signature: allow to pass a CSV-separated string
- to specify argnames. For example:
+- simplify pytest.mark.parametrize() signature: allow to pass a
+ CSV-separated string to specify argnames. For example:
``pytest.mark.parametrize("input,expected", [(1,2), (2,3)])``
works as well as the previous:
``pytest.mark.parametrize(("input", "expected"), ...)``.
@@ -75,11 +78,12 @@
- integrate tab-completion on options through use of "argcomplete".
Thanks Anthon van der Neut for the PR.
-- change option names to be hyphen-separated long options but keep the old spelling
- backward compatible. py.test -h will only show the hyphenated version,
- for example "--collect-only" but "--collectonly" will remain valid as well
- (for backward-compat reasons). Many thanks to Anthon van der Neut for
- the implementation and to Hynek Schlawack for pushing us.
+- change option names to be hyphen-separated long options but keep the
+ old spelling backward compatible. py.test -h will only show the
+ hyphenated version, for example "--collect-only" but "--collectonly"
+ will remain valid as well (for backward-compat reasons). Many thanks to
+ Anthon van der Neut for the implementation and to Hynek Schlawack for
+ pushing us.
- fix issue 308 - allow to mark/xfail/skip individual parameter sets
when parametrizing. Thanks Brianna Laugher.
@@ -141,7 +145,6 @@
- fix issue 306 - cleanup of -k/-m options to only match markers/test
names/keywords respectively. Thanks Wouter van Ackooy.
-
- improved doctest counting for doctests in python modules --
files without any doctest items will not show up anymore
and doctest examples are counted as separate test items.
diff -r 6a3d8793bf5fe8f9be829bddb8bf1e95ee183323 -r cbeecb03918ab64f80f31af81c65a78799efe443 _pytest/__init__.py
--- a/_pytest/__init__.py
+++ b/_pytest/__init__.py
@@ -1,2 +1,2 @@
#
-__version__ = '2.4.0.dev13'
+__version__ = '2.4.0.dev14'
diff -r 6a3d8793bf5fe8f9be829bddb8bf1e95ee183323 -r cbeecb03918ab64f80f31af81c65a78799efe443 _pytest/capture.py
--- a/_pytest/capture.py
+++ b/_pytest/capture.py
@@ -29,6 +29,11 @@
except ValueError:
pass
early_config.pluginmanager.add_shutdown(teardown)
+ # make sure logging does not raise exceptions if it is imported
+ def silence_logging_at_shutdown():
+ if "logging" in sys.modules:
+ sys.modules["logging"].raiseExceptions = False
+ early_config.pluginmanager.add_shutdown(silence_logging_at_shutdown)
# finally trigger conftest loading but while capturing (issue93)
capman.resumecapture()
diff -r 6a3d8793bf5fe8f9be829bddb8bf1e95ee183323 -r cbeecb03918ab64f80f31af81c65a78799efe443 setup.py
--- a/setup.py
+++ b/setup.py
@@ -11,7 +11,7 @@
name='pytest',
description='py.test: simple powerful testing with Python',
long_description = long_description,
- version='2.4.0.dev13',
+ version='2.4.0.dev14',
url='http://pytest.org',
license='MIT license',
platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'],
diff -r 6a3d8793bf5fe8f9be829bddb8bf1e95ee183323 -r cbeecb03918ab64f80f31af81c65a78799efe443 testing/acceptance_test.py
--- a/testing/acceptance_test.py
+++ b/testing/acceptance_test.py
@@ -586,9 +586,9 @@
result = testdir.runpytest("--durations=10")
assert result.ret == 0
- result.stdout.fnmatch_lines([
- "*durations*",
- "* setup *test_1*",
- "* call *test_1*",
- ])
+ result.stdout.fnmatch_lines_random("""
+ *durations*
+ * setup *test_1*
+ * call *test_1*
+ """)
diff -r 6a3d8793bf5fe8f9be829bddb8bf1e95ee183323 -r cbeecb03918ab64f80f31af81c65a78799efe443 testing/test_capture.py
--- a/testing/test_capture.py
+++ b/testing/test_capture.py
@@ -437,7 +437,6 @@
])
assert result.ret == 2
- @pytest.mark.xfail("sys.version_info < (2,7)")
@pytest.mark.issue14
def test_capture_and_logging(self, testdir):
p = testdir.makepyfile("""
diff -r 6a3d8793bf5fe8f9be829bddb8bf1e95ee183323 -r cbeecb03918ab64f80f31af81c65a78799efe443 tox.ini
--- a/tox.ini
+++ b/tox.ini
@@ -1,6 +1,6 @@
[tox]
distshare={homedir}/.tox/distshare
-envlist=py26,py27,py27-nobyte,py32,py33,py27-xdist,trial
+envlist=py25,py26,py27,py27-nobyte,py32,py33,py27-xdist,trial
[testenv]
changedir=testing
Repository URL: https://bitbucket.org/hpk42/pytest/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the pytest-commit
mailing list