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(