MarketSquare / MarketSquare/robotframework-requests
Please make `disable_warnings=0` turn warnings back on?
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 512
- Forks
- 283
- PR merge metrics
- No merged PRs in 30d
Description
It looks like the code only ever globally turns warnings off, but can never turn them back on again.
I have a situation where I need to follow best-practices and only narrowly silence warnings for a single GET request, which generates spurious and expected warnings, but then expose warnings as normal for all other calls.
So it would be really great if disable_warnings=0 turned all of the warnings back on.
(Currently I'm working around this by just exposing our own custom keywords that adjust the urllib3 warnings and log level at the most narrow granularity possible, but I think it would be better to have this functionality in the library.)
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.
Research direction
Start in src/RequestsLibrary/RequestsKeywords.py around lines 120-127, where disable_warnings is handled, and trace how warning state is changed. Confirm the current behavior for disable_warnings=0 and determine how the existing test coverage exercises this keyword. Done means warnings can be disabled for a request and restored for later calls when the option is set to 0.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100