From a279ec61df6107dd54cd8f1bdd51fb556a7f3052 Mon Sep 17 00:00:00 2001 From: gesh Date: Mon, 23 Jun 2025 19:00:28 +0300 Subject: [PATCH 1/2] Catch ImportError The handling is probably incorrect, but on the platforms I'm testing on this test is skipped anyway -- this just allows a simple `python -m pytest` to succeed --- tests/test_stdin.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/test_stdin.py b/tests/test_stdin.py index 212b309..87ba9d2 100644 --- a/tests/test_stdin.py +++ b/tests/test_stdin.py @@ -1,8 +1,15 @@ """Tests for polyfill's stdin monkey patching.""" import flake8 -import pep8 -import pycodestyle import pytest +try: + import pep8 +except ImportError: + pep8 = None + +try: + import pycodestyle +except ImportError: + pycodestyle = None from flake8_polyfill import stdin from flake8_polyfill import version From f006b886815cff8b7ce23b1f76ab0a0f020e7dd9 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 23 Jun 2025 16:24:18 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- tests/test_stdin.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_stdin.py b/tests/test_stdin.py index 87ba9d2..2ed346e 100644 --- a/tests/test_stdin.py +++ b/tests/test_stdin.py @@ -1,6 +1,7 @@ """Tests for polyfill's stdin monkey patching.""" import flake8 import pytest + try: import pep8 except ImportError: