Skip to content

Commit 3392d57

Browse files
remove warnings
1 parent ba317a4 commit 3392d57

File tree

3 files changed

+41
-69
lines changed

3 files changed

+41
-69
lines changed

pyproject.toml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,44 @@ classmethod-decorators = ["classmethod", "validator"]
106106
[tool.ruff.lint.pydocstyle]
107107
convention = "google"
108108

109+
# Pytest configuration
110+
[tool.pytest.ini_options]
111+
testpaths = ["tests"]
112+
python_files = ["test_*.py"]
113+
python_classes = ["Test*"]
114+
python_functions = ["test_*"]
115+
asyncio_mode = "auto"
116+
addopts = [
117+
"--cov=stagehand",
118+
"--cov-report=html:htmlcov",
119+
"--cov-report=term-missing",
120+
"--cov-report=xml",
121+
"--cov-fail-under=75",
122+
"--strict-markers",
123+
"--strict-config",
124+
"-ra",
125+
"--tb=short"
126+
]
127+
markers = [
128+
"unit: Unit tests for individual components",
129+
"integration: Integration tests requiring multiple components",
130+
"e2e: End-to-end tests with full workflows",
131+
"slow: Tests that take longer to run",
132+
"browserbase: Tests requiring Browserbase connection",
133+
"local: Tests for local browser functionality",
134+
"llm: Tests involving LLM interactions",
135+
"mock: Tests using mock objects only",
136+
"performance: Performance and load tests",
137+
"smoke: Quick smoke tests for basic functionality"
138+
]
139+
filterwarnings = [
140+
"ignore::DeprecationWarning",
141+
"ignore::PendingDeprecationWarning",
142+
"ignore::UserWarning:pytest_asyncio",
143+
"ignore::RuntimeWarning"
144+
]
145+
minversion = "7.0"
146+
109147
# Black configuration
110148
[tool.black]
111149
line-length = 88

pytest.ini

Lines changed: 0 additions & 69 deletions
This file was deleted.

tests/unit/core/test_page.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ def test_page_attribute_forwarding(self, mock_playwright_page):
4040
mock_client.env = "LOCAL"
4141
mock_client.logger = MagicMock()
4242

43+
# Ensure keyboard.press returns a regular value, not a coroutine
44+
mock_playwright_page.keyboard.press.return_value = None
45+
4346
page = StagehandPage(mock_playwright_page, mock_client)
4447

4548
# Should forward attribute access to underlying page

0 commit comments

Comments
 (0)