From c695763e92951e20bd10c783c47884032826ea6d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 7 Feb 2023 07:58:55 -0300 Subject: [PATCH] [pre-commit.ci] pre-commit autoupdate (#869) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/PyCQA/autoflake: v2.0.0 → v2.0.1](https://github.com/PyCQA/autoflake/compare/v2.0.0...v2.0.1) - [github.com/psf/black: 22.12.0 → 23.1.0](https://github.com/psf/black/compare/22.12.0...23.1.0) - [github.com/asottile/blacken-docs: v1.12.1 → 1.13.0](https://github.com/asottile/blacken-docs/compare/v1.12.1...1.13.0) * Update .pre-commit-config.yaml * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Bruno Oliveira --- .pre-commit-config.yaml | 8 ++++---- docs/how-to.rst | 6 +++--- src/xdist/looponfail.py | 1 - src/xdist/scheduler/loadscope.py | 2 -- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bcd6cc2c..5548f775 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,19 +1,19 @@ repos: - repo: https://github.com/PyCQA/autoflake - rev: v2.0.0 + rev: v2.0.1 hooks: - id: autoflake args: ["--in-place", "--remove-unused-variables", "--remove-all-unused-imports"] - repo: https://github.com/psf/black - rev: 22.12.0 + rev: 23.1.0 hooks: - id: black args: [--safe, --quiet, --target-version, py35] - repo: https://github.com/asottile/blacken-docs - rev: v1.12.1 + rev: 1.13.0 hooks: - id: blacken-docs - additional_dependencies: [black==20.8b1] + additional_dependencies: [black==23.1.0] - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.4.0 hooks: diff --git a/docs/how-to.rst b/docs/how-to.rst index 5d6ed128..bf8362af 100644 --- a/docs/how-to.rst +++ b/docs/how-to.rst @@ -15,7 +15,7 @@ a test or fixture, you may use the ``worker_id`` fixture to do so: @pytest.fixture() def user_account(worker_id): - """ use a different account in each xdist worker """ + """use a different account in each xdist worker""" return "account_%s" % worker_id When ``xdist`` is disabled (running with ``-n0`` for example), then @@ -80,7 +80,7 @@ wanted to create a separate database for each test run: @pytest.fixture(scope="session", autouse=True) def create_unique_database(testrun_uid): - """ create a unique database for this particular test run """ + """create a unique database for this particular test run""" database_url = f"psql://myapp-{testrun_uid}" with Semaphore(f"/{testrun_uid}-lock", flags=O_CREAT, initial_value=1): @@ -90,7 +90,7 @@ wanted to create a separate database for each test run: @pytest.fixture() def db(testrun_uid): - """ retrieve unique database """ + """retrieve unique database""" database_url = f"psql://myapp-{testrun_uid}" return database_get_instance(database_url) diff --git a/src/xdist/looponfail.py b/src/xdist/looponfail.py index 59ba7ebe..41a35b67 100644 --- a/src/xdist/looponfail.py +++ b/src/xdist/looponfail.py @@ -35,7 +35,6 @@ def pytest_addoption(parser): @pytest.hookimpl def pytest_cmdline_main(config): - if config.getoption("looponfail"): usepdb = config.getoption("usepdb", False) # a core option if usepdb: diff --git a/src/xdist/scheduler/loadscope.py b/src/xdist/scheduler/loadscope.py index ad99125f..35a9ef34 100644 --- a/src/xdist/scheduler/loadscope.py +++ b/src/xdist/scheduler/loadscope.py @@ -213,13 +213,11 @@ def add_node_collection(self, node, collection): # A new node has been added later, perhaps an original one died. if self.collection_is_completed: - # Assert that .schedule() should have been called by now assert self.collection # Check that the new collection matches the official collection if collection != self.collection: - other_node = next(iter(self.registered_collections.keys())) msg = report_collection_diff(