From 504b02dde30407a12542943191387e095e875db3 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 10 May 2022 04:30:10 +0000 Subject: [PATCH] [pre-commit.ci] pre-commit autoupdate (#459) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/asottile/pyupgrade: v2.32.0 → v2.32.1](https://github.com/asottile/pyupgrade/compare/v2.32.0...v2.32.1) - [github.com/pre-commit/mirrors-mypy: v0.942 → v0.950](https://github.com/pre-commit/mirrors-mypy/compare/v0.942...v0.950) * fix types Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Adam Johnson --- .pre-commit-config.yaml | 4 ++-- src/pytest_randomly/__init__.py | 9 +++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9b412d6..2ccfcc9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,7 +14,7 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/asottile/pyupgrade - rev: v2.32.0 + rev: v2.32.1 hooks: - id: pyupgrade args: [--py37-plus] @@ -42,7 +42,7 @@ repos: - flake8-tidy-imports - flake8-typing-imports - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.942 + rev: v0.950 hooks: - id: mypy additional_dependencies: diff --git a/src/pytest_randomly/__init__.py b/src/pytest_randomly/__init__.py index da3957e..2f12ad7 100644 --- a/src/pytest_randomly/__init__.py +++ b/src/pytest_randomly/__init__.py @@ -135,7 +135,7 @@ def pytest_configure_node(self, node: Item) -> None: node.workerinput["randomly_seed"] = seed # type: ignore [attr-defined] -random_states: dict[int, object] = {} +random_states: dict[int, tuple[Any, ...]] = {} np_random_states: dict[int, Any] = {} @@ -166,11 +166,8 @@ def _reseed(config: Config, offset: int = 0) -> int: np_random.set_state(np_random_states[numpy_seed]) if entrypoint_reseeds is None: - # typeshed missing correct types for latest importlib.metadata changes - eps = entry_points( - group="pytest_randomly.random_seeder", # type: ignore [call-arg] - ) - entrypoint_reseeds = [e.load() for e in eps] # type: ignore [attr-defined] + eps = entry_points(group="pytest_randomly.random_seeder") + entrypoint_reseeds = [e.load() for e in eps] for reseed in entrypoint_reseeds: reseed(seed)