From 2f48ae4e66eda4c2601eea56efc3b692bf1cd507 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Tue, 28 May 2019 08:11:18 -0700 Subject: [PATCH 1/4] Correct some tiny typos in changelog --- CHANGELOG.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 86a2d9b84..a1bcd1917 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -627,7 +627,7 @@ Removals See our `docs `__ on information on how to update your code. -- `#3086 `_: ``[pytest]`` section in **setup.cfg** files is not longer supported, use ``[tool:pytest]`` instead. ``setup.cfg`` files +- `#3086 `_: ``[pytest]`` section in **setup.cfg** files is no longer supported, use ``[tool:pytest]`` instead. ``setup.cfg`` files are meant for use with ``distutils``, and a section named ``pytest`` has notoriously been a source of conflicts and bugs. Note that for **pytest.ini** and **tox.ini** files the section remains ``[pytest]``. @@ -1849,7 +1849,7 @@ Features exits the debugger. On python 3.2 and higher, use CTRL+D. (`#3299 `_) -- pytest not longer changes the log level of the root logger when the +- pytest no longer changes the log level of the root logger when the ``log-level`` parameter has greater numeric value than that of the level of the root logger, which makes it play better with custom logging configuration in user code. (`#3307 `_) From 2e2e895b4b9d9a5367128e9a0bf379120c0c89d4 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Tue, 28 May 2019 09:01:26 -0700 Subject: [PATCH 2/4] Temporarily pin pluggy on master --- .travis.yml | 5 +++++ setup.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ecbba1255..728048cce 100644 --- a/.travis.yml +++ b/.travis.yml @@ -115,6 +115,11 @@ matrix: allow_failures: - python: '3.8-dev' env: TOXENV=py38-xdist + # temporary until pytest 4.6 is released + - env: TOXENV=py27-pluggymaster-xdist + python: '2.7' + - env: TOXENV=py37-pluggymaster-xdist + before_script: - | diff --git a/setup.py b/setup.py index c16504411..a5b4de5f4 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ INSTALL_REQUIRES = [ 'funcsigs>=1.0;python_version<"3.0"', 'pathlib2>=2.2.0;python_version<"3.6"', 'colorama;sys_platform=="win32"', - "pluggy>=0.9,!=0.10,<1.0", + "pluggy==0.11", # temporary until 4.6 is released "wcwidth", ] From 0025e4408f51b9d1eecd36a4692e61721c883cc4 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Mon, 27 May 2019 03:20:58 +0200 Subject: [PATCH 3/4] conftest: add uses_pexpect mark --- testing/conftest.py | 13 +++++++++---- tox.ini | 2 ++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/testing/conftest.py b/testing/conftest.py index ecc945279..a068550e8 100644 --- a/testing/conftest.py +++ b/testing/conftest.py @@ -11,9 +11,10 @@ def pytest_collection_modifyitems(config, items): """ fast_items = [] slow_items = [] + slowest_items = [] neutral_items = [] - slow_fixturenames = ("testdir",) + spawn_names = {"spawn_pytest", "spawn"} for item in items: try: @@ -23,12 +24,16 @@ def pytest_collection_modifyitems(config, items): # (https://github.com/pytest-dev/pytest/issues/5070) neutral_items.append(item) else: - if any(x for x in fixtures if x in slow_fixturenames): - slow_items.append(item) + if "testdir" in fixtures: + if spawn_names.intersection(item.function.__code__.co_names): + item.add_marker(pytest.mark.uses_pexpect) + slow_items.append(item) + else: + slowest_items.append(0) else: marker = item.get_closest_marker("slow") if marker: - slow_items.append(item) + slowest_items.append(item) else: fast_items.append(item) diff --git a/tox.ini b/tox.ini index 1f024b2f5..a04f91ae5 100644 --- a/tox.ini +++ b/tox.ini @@ -175,6 +175,8 @@ markers = baz # conftest.py reorders tests moving slow ones to the end of the list slow + # experimental mark for all tests using pexpect + uses_pexpect [flake8] max-line-length = 120 From 61b76c7f5ffd760d590d761cea763ba96fc626f6 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Wed, 29 May 2019 21:30:45 +0200 Subject: [PATCH 4/4] tests: conftest: fix collection of slow/slowest items --- testing/conftest.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/testing/conftest.py b/testing/conftest.py index a068550e8..4badf3016 100644 --- a/testing/conftest.py +++ b/testing/conftest.py @@ -27,9 +27,9 @@ def pytest_collection_modifyitems(config, items): if "testdir" in fixtures: if spawn_names.intersection(item.function.__code__.co_names): item.add_marker(pytest.mark.uses_pexpect) - slow_items.append(item) + slowest_items.append(item) else: - slowest_items.append(0) + slow_items.append(item) else: marker = item.get_closest_marker("slow") if marker: @@ -37,6 +37,6 @@ def pytest_collection_modifyitems(config, items): else: fast_items.append(item) - items[:] = fast_items + neutral_items + slow_items + items[:] = fast_items + neutral_items + slow_items + slowest_items yield