Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: pytest-dev/pytest-xdist
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.0.2
Choose a base ref
...
head repository: pytest-dev/pytest-xdist
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v3.1.0
Choose a head ref
  • 19 commits
  • 17 files changed
  • 5 contributors

Commits on Oct 25, 2022

  1. Merge pull request #830 from nicoddemus/release-3.0.0

    Release 3.0.2
    nicoddemus authored Oct 25, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    7949c14 View commit details

Commits on Oct 28, 2022

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    873c1fd View commit details
  2. Merge pull request #838 from pytest-dev/hroncok-patch-1

    Remove deprecated stuff from the package description
    nicoddemus authored Oct 28, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    e232b78 View commit details

Commits on Nov 5, 2022

  1. Update pre-commit

    Also:
    
    * Configure flake8 to ignore formatting-related problems (let black worry about them).
    * Fix reference to Python 3.10 in CI,
    
    Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
    graingert and nicoddemus authored Nov 5, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    59457cc View commit details
  2. Run pyupgrade --py37-plus

    nicoddemus committed Nov 5, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    d7d396a View commit details
  3. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    2ffb426 View commit details
  4. Copy the full SHA
    66993ec View commit details
  5. Copy the full SHA
    aee850a View commit details
  6. Copy the full SHA
    0316baf View commit details
  7. Merge pull request #842 from nicoddemus/drop-py36-add-py311

    Drop Python 3.6 and add Python 3.11
    nicoddemus authored Nov 5, 2022
    Copy the full SHA
    6b6f133 View commit details

Commits on Nov 15, 2022

  1. [pre-commit.ci] pre-commit autoupdate

    updates:
    - [github.com/asottile/pyupgrade: v3.2.0 → v3.2.2](asottile/pyupgrade@v3.2.0...v3.2.2)
    - [github.com/pre-commit/mirrors-mypy: v0.982 → v0.990](pre-commit/mirrors-mypy@v0.982...v0.990)
    pre-commit-ci[bot] authored Nov 15, 2022
    Copy the full SHA
    41620d2 View commit details
  2. Use ternary operator to remove mypy error

    Otherwise we would get this error:
    
    ```
    error: Function "Callable[[Any, bool, Optional[float]], None]" could always be true in boolean context  [truthy-function]
    ```
    nicoddemus committed Nov 15, 2022
    Copy the full SHA
    4a33933 View commit details
  3. Merge pull request #844 from pytest-dev/pre-commit-ci-update-config

    [pre-commit.ci] pre-commit autoupdate
    nicoddemus authored Nov 15, 2022
    Copy the full SHA
    bb27210 View commit details

Commits on Nov 22, 2022

  1. [pre-commit.ci] pre-commit autoupdate (#846)

    updates:
    - [github.com/pre-commit/mirrors-mypy: v0.990 → v0.991](pre-commit/mirrors-mypy@v0.990...v0.991)
    
    Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
    pre-commit-ci[bot] authored Nov 22, 2022
    Copy the full SHA
    e14895a View commit details

Commits on Nov 24, 2022

  1. Fix typo psutils -> psutil (#848)

    BreadGenie authored Nov 24, 2022
    Copy the full SHA
    99c80c3 View commit details

Commits on Nov 29, 2022

  1. [pre-commit.ci] pre-commit autoupdate (#849)

    updates:
    - [github.com/PyCQA/autoflake: v1.7.7 → v2.0.0](PyCQA/autoflake@v1.7.7...v2.0.0)
    - [github.com/pre-commit/pre-commit-hooks: v4.3.0 → v4.4.0](pre-commit/pre-commit-hooks@v4.3.0...v4.4.0)
    - [github.com/PyCQA/flake8: 5.0.4 → 6.0.0](PyCQA/flake8@5.0.4...6.0.0)
    
    Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
    pre-commit-ci[bot] authored Nov 29, 2022
    Copy the full SHA
    c6bcd20 View commit details

Commits on Nov 30, 2022

  1. Copy the full SHA
    7a0bc4c View commit details

Commits on Dec 1, 2022

  1. Merge pull request #851 from nicoddemus/789-default-dist-mode

    Let users configure dist mode in the configuration file
    nicoddemus authored Dec 1, 2022
    Copy the full SHA
    6226965 View commit details
  2. Release 3.1.0

    nicoddemus committed Dec 1, 2022
    Copy the full SHA
    92a76bb View commit details
33 changes: 33 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: deploy

on:
push:
tags:
- "v*"

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
# Needed to fetch tags, which are required by setuptools-scm.
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install build
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: |
python -m build
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_token }}
87 changes: 0 additions & 87 deletions .github/workflows/main.yml

This file was deleted.

67 changes: 67 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: test

on:
push:
branches:
- "*"

pull_request:
branches:
- "*"

jobs:
test:

runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
tox_env:
- "py37-pytestlatest"
- "py38-pytestlatest"
- "py39-pytestlatest"
- "py310-pytestlatest"
- "py310-pytestmain"
- "py311-pytestlatest"
- "py311-pytestmain"
- "py310-psutil"
- "py310-setproctitle"

os: [ubuntu-latest, windows-latest]
include:
- tox_env: "py37-pytestlatest"
python: "3.7"
- tox_env: "py38-pytestlatest"
python: "3.8"
- tox_env: "py39-pytestlatest"
python: "3.9"
- tox_env: "py310-pytestlatest"
python: "3.10"
- tox_env: "py310-pytestmain"
python: "3.10"
- tox_env: "py311-pytestlatest"
python: "3.11"
- tox_env: "py311-pytestmain"
python: "3.11"
- tox_env: "py310-psutil"
python: "3.10"
- tox_env: "py310-setproctitle"
python: "3.10"

steps:
- uses: actions/checkout@v3
with:
# Needed to fetch tags, which are required by setuptools-scm.
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Install tox
run: |
python -m pip install --upgrade pip
pip install tox
- name: Test
run: |
tox -e ${{ matrix.tox_env }}
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
repos:
- repo: https://github.com/PyCQA/autoflake
rev: v1.7.6
rev: v2.0.0
hooks:
- id: autoflake
args: ["--in-place", "--remove-unused-variables", "--remove-all-unused-imports"]
- repo: https://github.com/psf/black
rev: 22.3.0
rev: 22.10.0
hooks:
- id: black
args: [--safe, --quiet, --target-version, py35]
@@ -15,18 +15,18 @@ repos:
- id: blacken-docs
additional_dependencies: [black==20.8b1]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: debug-statements
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
rev: 6.0.0
hooks:
- id: flake8
- repo: https://github.com/asottile/pyupgrade
rev: v2.32.1
rev: v3.2.2
hooks:
- id: pyupgrade
args: [--py3-plus]
@@ -39,7 +39,7 @@ repos:
language: python
additional_dependencies: [pygments, restructuredtext_lint]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.960
rev: v0.991
hooks:
- id: mypy
files: ^(src/|testing/)
22 changes: 22 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
pytest-xdist 3.1.0 (2022-12-01)
===============================

Features
--------

- `#789 <https://github.com/pytest-dev/pytest-xdist/issues/789>`_: Users can now set a default distribution mode in their configuration file:

.. code-block:: ini
[pytest]
addopts = --dist loadscope
- `#842 <https://github.com/pytest-dev/pytest-xdist/issues/842>`_: Python 3.11 is now officially supported.


Removals
--------

- `#842 <https://github.com/pytest-dev/pytest-xdist/issues/842>`_: Python 3.6 is no longer supported.


pytest-xdist 3.0.2 (2022-10-25)
===============================

2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ pytest-xdist
:alt: Python versions
:target: https://pypi.python.org/pypi/pytest-xdist

.. image:: https://github.com/pytest-dev/pytest-xdist/workflows/build/badge.svg
.. image:: https://github.com/pytest-dev/pytest-xdist/workflows/test/badge.svg
:target: https://github.com/pytest-dev/pytest-xdist/actions

.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
2 changes: 1 addition & 1 deletion docs/distribution.rst
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ With ``-n auto``, pytest-xdist will use as many processes as your computer
has CPU cores.

Use ``-n logical`` to use the number of *logical* CPU cores rather than
physical ones. This currently requires the ``psutils`` package to be installed;
physical ones. This currently requires the ``psutil`` package to be installed;
if it is not, pytest-xdist will fall back to ``-n auto`` behavior.

Pass a number, e.g. ``-n 8``, to specify the number of processes explicitly.
8 changes: 5 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = pytest-xdist
description = pytest xdist plugin for distributed testing and loop-on-failing modes
description = pytest xdist plugin for distributed testing, most importantly across multiple CPUs
long_description = file: README.rst
license = MIT
author = holger krekel and contributors
@@ -24,11 +24,11 @@ classifiers =
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
license_file = LICENSE
project_urls =
Documentation=https://pytest-xdist.readthedocs.io/en/latest
@@ -40,7 +40,7 @@ project_urls =
packages = find:
package_dir = =src
zip_safe = False
python_requires = >=3.6
python_requires = >=3.7
install_requires =
execnet>=1.1
pytest>=6.2.0
@@ -60,6 +60,8 @@ psutil = psutil>=3.0
setproctitle = setproctitle

[flake8]
# Ignore any errors related to formatting, let black worry/fix them.
ignore = E501, W503, E203
max-line-length = 100

[mypy]
12 changes: 5 additions & 7 deletions src/xdist/dsession.py
Original file line number Diff line number Diff line change
@@ -169,7 +169,7 @@ def worker_workerfinished(self, node):
"""
self.config.hook.pytest_testnodedown(node=node, error=None)
if node.workeroutput["exitstatus"] == 2: # keyboard-interrupt
self.shouldstop = "{} received keyboard-interrupt".format(node)
self.shouldstop = f"{node} received keyboard-interrupt"
self.worker_errordown(node, "keyboard-interrupt")
return
if node in self.sched.nodes:
@@ -230,7 +230,7 @@ def worker_errordown(self, node, error):
@pytest.hookimpl
def pytest_terminal_summary(self, terminalreporter):
if self.config.option.verbose >= 0 and self._summary_report:
terminalreporter.write_sep("=", "xdist: {}".format(self._summary_report))
terminalreporter.write_sep("=", f"xdist: {self._summary_report}")

def worker_collectionfinish(self, node, ids):
"""worker has finished test collection.
@@ -345,7 +345,7 @@ def handle_crashitem(self, nodeid, worker):
# XXX count no of failures and retry N times
runner = self.config.pluginmanager.getplugin("runner")
fspath = nodeid.split("::")[0]
msg = "worker {!r} crashed while running {!r}".format(worker.gateway.id, nodeid)
msg = f"worker {worker.gateway.id!r} crashed while running {nodeid!r}"
rep = runner.TestReport(
nodeid, (fspath, None, fspath), (), "failed", msg, "???"
)
@@ -381,9 +381,7 @@ def setstatus(self, spec, status, show=True):

def getstatus(self):
if self.config.option.verbose >= 0:
parts = [
"{} {}".format(spec.id, self._status[spec.id]) for spec in self._specs
]
parts = [f"{spec.id} {self._status[spec.id]}" for spec in self._specs]
return " / ".join(parts)
else:
return "bringing up nodes..."
@@ -431,7 +429,7 @@ def pytest_testnodeready(self, node):
def pytest_testnodedown(self, node, error):
if not error:
return
self.write_line("[{}] node down: {}".format(node.gateway.id, error))
self.write_line(f"[{node.gateway.id}] node down: {error}")


def get_default_max_worker_restart(config):
2 changes: 1 addition & 1 deletion src/xdist/looponfail.py
Original file line number Diff line number Diff line change
@@ -146,7 +146,7 @@ def repr_pytest_looponfailinfo(failreports, rootdirs):
tr.line(report, red=True)
tr.sep("#", "waiting for changes", bold=True)
for rootdir in rootdirs:
tr.line("### Watching: {}".format(rootdir), bold=True)
tr.line(f"### Watching: {rootdir}", bold=True)


def init_worker_session(channel, args, option_dict):
Loading