Extension example catches its own assertions and cannot detect failed deletion
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 84/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- python
- Domain
- testing-qa
Research direction
Start with the two deletion-verification blocks in examples/playwright_extensions.py:127-132 and 134-143, then inspect how examples/e2e/test_playwright.py exercises the example. Ensure unexpected success is not treated as an expected failure, and run the relevant E2E test to verify deletion regressions are detected.
Written by the indexing model from the issue text.
Description
Description
The extension example's two deletion-verification blocks catch their own AssertionError. If retrieving a deleted extension or creating a session with it unexpectedly succeeds, the code raises AssertionError, immediately catches it with except Exception, and prints that failure occurred "as expected".
Code reference
examples/playwright_extensions.py:127-132examples/playwright_extensions.py:134-143
Reproduction
The control-flow problem can be demonstrated without Browserbase credentials:
try:
# Simulate get_extension() unexpectedly succeeding.
object()
raise AssertionError("Expected to fail when retrieving deleted extension")
except Exception as exc:
print(f"Failed as expected: {exc}")
The output claims an expected failure even though the operation succeeded and only the example's own assertion failed.
Expected behavior
Only the API operation should be inside the try, with the success assertion in else, or the code should catch the specific expected Browserbase exception. Unexpected success must fail the example/E2E test.
Actual behavior
Both negative checks are guaranteed to print an expected-failure message for either outcome, so regressions in extension deletion can pass silently.
Why it matters
examples/e2e/test_playwright.py exercises this example. False-positive cleanup checks weaken E2E coverage for deletion semantics and can mask a server or SDK regression.
- Dominant language
- Python
- Stars
- 93
- Forks
- 16
- Avg merge
- 11m
- Merged PRs (30d)
- 3
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from browserbase/sdk-python
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
browserbase/sdk-python#182 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
browserbase/sdk-python#179 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
browserbase/sdk-python#178 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
browserbase/sdk-python#176 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
browserbase/sdk-python#175 ·
All issues in browserbase/sdk-python
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100