Skip configuration for certain paths only
See original GitHub issueIs your feature request related to a problem? Please describe. I’m a bit annoyed by the B101 assert_used warnings in my testing code, as pytest recommends (and I follow) using assert statements. It’s confusing that bandit complains about them. On the other hand, I want to be warned about using assert in my non-test code.
Describe the solution you’d like
I’d like to be able to ignore pattern B101 for the /tests folder only.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:5 (2 by maintainers)
 Top Results From Across the Web
Top Results From Across the Web
Spring Boot Security wont ignore certain paths that dont need ...
The problem is that I want everything in my /api/v1/auth/ controller to not go through the JWT filter chain. This is what my...
Read more >Skip rules for path components - Trellix Product Documentation
Application Control searches the specified path component across all volumes and applies skip rules on that particular path component present on a system....
Read more >Skipped Paths | PhpStorm Documentation - JetBrains
If a script is added to Skipped paths, it is only skipped when starting a debugging session for it. To ignore a script...
Read more >Achieve path-based routing on an Application Load Balancer
Configure listener rules. Before creating the target groups, be sure that the following prerequisites are met: You launched the Amazon Elastic ...
Read more >Configuration — yamllint 1.28.0 documentation - Read the Docs
extends: default ignore: | /this/specific/file.yaml all/this/directory/ *.template.yaml. or ignore paths only for specific rules:.
Read more > Top Related Medium Post
Top Related Medium Post
No results found
 Top Related StackOverflow Question
Top Related StackOverflow Question
No results found
 Troubleshoot Live Code
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free Top Related Reddit Thread
Top Related Reddit Thread
No results found
 Top Related Hackernoon Post
Top Related Hackernoon Post
No results found
 Top Related Tweet
Top Related Tweet
No results found
 Top Related Dev.to Post
Top Related Dev.to Post
No results found
 Top Related Hashnode Post
Top Related Hashnode Post
No results found

Alternatively, can we make Bandit a bit smarter in a way that it recognizes when
assertis used in a test module, and not warn about it?I am facing the same issue, is there a way to exclude B101 in the /tests folder? I tried to use the
assert_usedbut this does not seem to work.