Check for prints (#616)

* Check for prints

* format
This commit is contained in:
Jack Gerrits 2024-09-23 16:10:57 -04:00 committed by GitHub
parent 0172c7131d
commit dc02719f7c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 16 additions and 9 deletions

View File

@ -45,6 +45,10 @@ include = [
"src/**"
]
[tool.ruff.lint]
# Allow prints in this package
ignore = ["T20"]
[tool.pyright]
extends = "../../pyproject.toml"
include = ["src"]

View File

@ -74,6 +74,10 @@ extend = "../../pyproject.toml"
exclude = ["build", "dist", "src/autogen_core/application/protos"]
include = ["src/**", "samples/*.py", "docs/**/*.ipynb", "tests/**"]
[tool.ruff.lint.per-file-ignores]
"samples/**.py" = ["T20"]
"docs/**.ipynb" = ["T20"]
[tool.pyright]
extends = "../../pyproject.toml"
include = ["src", "tests", "samples"]

View File

@ -19,8 +19,7 @@ from typing import List
from autogen_core.application import SingleThreadedAgentRuntime
from autogen_core.base import AgentId, AgentInstantiationContext
from autogen_core.components import DefaultTopicId, RoutedAgent, message_handler
from autogen_core.components import DefaultSubscription
from autogen_core.components import DefaultSubscription, DefaultTopicId, RoutedAgent, message_handler
from autogen_core.components.models import (
AssistantMessage,
ChatCompletionClient,

View File

@ -395,6 +395,5 @@ def add_two_numbers(a: int, b: int) -> int:
cancellation_token=cancellation_token,
)
# result.output = result.output.encode().decode('unicode_escape')
print(azure_result.output)
assert "TypeError: unsupported operand type(s) for +:" in azure_result.output
assert azure_result.exit_code == 1

View File

@ -4,8 +4,7 @@ from dataclasses import dataclass
import pytest
from autogen_core.application import SingleThreadedAgentRuntime
from autogen_core.base import AgentId, AgentRuntime, MessageContext
from autogen_core.components import ClosureAgent
from autogen_core.components import DefaultSubscription
from autogen_core.components import ClosureAgent, DefaultSubscription
from autogen_core.components._default_topic import DefaultTopicId

View File

@ -2,8 +2,7 @@ import pytest
from autogen_core.application import SingleThreadedAgentRuntime
from autogen_core.base import AgentId, TopicId
from autogen_core.base.exceptions import CantHandleException
from autogen_core.components import DefaultTopicId, TypeSubscription
from autogen_core.components import DefaultSubscription
from autogen_core.components import DefaultSubscription, DefaultTopicId, TypeSubscription
from test_utils import LoopbackAgent, MessageType

View File

@ -72,6 +72,9 @@ include = [
"tests/**/*.py",
]
[tool.ruff.lint.per-file-ignores]
"src/team_one/utils.py" = ["T20"]
[tool.pyright]
extends = "../../pyproject.toml"

View File

@ -196,7 +196,7 @@ setInterval(function() {{
""".strip(),
)
await self._page.screenshot(path=os.path.join(self.debug_dir, "screenshot.png"))
print(f"Multimodal Web Surfer debug screens: {pathlib.Path(os.path.abspath(debug_html)).as_uri()}\n")
logger.info(f"Multimodal Web Surfer debug screens: {pathlib.Path(os.path.abspath(debug_html)).as_uri()}\n")
async def _reset(self, cancellation_token: CancellationToken) -> None:
assert self._page is not None

View File

@ -33,7 +33,7 @@ target-version = "py310"
docstring-code-format = true
[tool.ruff.lint]
select = ["E", "F", "W", "B", "Q", "I", "ASYNC"]
select = ["E", "F", "W", "B", "Q", "I", "ASYNC", "T20"]
ignore = ["F401", "E501"]
[tool.ruff.lint.flake8-tidy-imports]