Pylons / Pylons/webtest

Please extend the documentation wrt exceptions that can be raised

Open
#133 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
346
Forks
113
PR merge metrics
No merged PRs in 30d

Description

Hello, sometimes the documentation mentions that a method can raise an exception but it doesn't mention the type of the exception. Sometimes there is no mention of any exception at all while it is clear that an exception must be raised. This means that I often end up with except Exception which is not a very good practice.

Let me mention some examples:

  • webtest.app.TestApp must raise an exception if the app argument is an invalid string
  • webtest.app.TestApp.get and friends must raise an exception if expect_errors==False
  • webtest.response.TestResponse.click must raise an exception if the link points to a failing URL
  • https://github.com/Pylons/webtest/issues/134
  • webtest.forms.Form.submit must raise an exception if the action attribute of the form points to a failing URL
  • webtest.forms.Form.__setitem__ must raise an exception if the field does not exist or if the name matches multiple fields

Can you please improve the documentation of the exceptions that may occur?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the documentation and implementations for webtest.app.TestApp and its get methods, webtest.response.TestResponse.click, and webtest.forms.Form.submit and setitem. Reproduce the listed invalid-input and failing-URL cases, consult issue #134, and document the specific exception types for each behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.