From 8ec02785011bf3264b7fbbbd72d0de931dd3b138 Mon Sep 17 00:00:00 2001 From: Lendemor Date: Fri, 20 Dec 2024 00:29:54 +0100 Subject: [PATCH] catch stray breakpoints and prints --- pyproject.toml | 2 +- reflex/testing.py | 6 +++--- reflex/utils/pyi_generator.py | 1 - 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6e8a431bc..464a3d4c7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -87,7 +87,7 @@ build-backend = "poetry.core.masonry.api" target-version = "py39" output-format = "concise" lint.isort.split-on-trailing-comma = false -lint.select = ["B", "C4", "D", "E", "ERA", "F", "FURB", "I", "PERF", "PTH", "RUF", "SIM", "W"] +lint.select = ["B", "C4", "D", "E", "ERA", "F", "FURB", "I", "PERF", "PTH", "RUF", "SIM", "T", "W"] lint.ignore = ["B008", "D205", "E501", "F403", "SIM115", "RUF006", "RUF012"] lint.pydocstyle.convention = "google" diff --git a/reflex/testing.py b/reflex/testing.py index ca31054b3..b3dedf398 100644 --- a/reflex/testing.py +++ b/reflex/testing.py @@ -52,6 +52,7 @@ from reflex.state import ( StateManagerRedis, reload_state_module, ) +from reflex.utils import console try: from selenium import webdriver # pyright: ignore [reportMissingImports] @@ -385,7 +386,7 @@ class AppHarness: ) if not line: break - print(line) # for pytest diagnosis + print(line) # for pytest diagnosis #noqa: T201 m = re.search(reflex.constants.Next.FRONTEND_LISTENING_REGEX, line) if m is not None: self.frontend_url = m.group(1) @@ -403,11 +404,10 @@ class AppHarness: ) # catch I/O operation on closed file. except ValueError as e: - print(e) + console.error(str(e)) break if not line: break - print(line) self.frontend_output_thread = threading.Thread(target=consume_frontend_output) self.frontend_output_thread.start() diff --git a/reflex/utils/pyi_generator.py b/reflex/utils/pyi_generator.py index c3a7b0ed1..a423ba8e7 100644 --- a/reflex/utils/pyi_generator.py +++ b/reflex/utils/pyi_generator.py @@ -1202,4 +1202,3 @@ class PyiGenerator: or "Var[Template]" in line ): line = line.rstrip() + " # type: ignore\n" - print(line, end="")