question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Skip configuration for certain paths only

See original GitHub issue

Is 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:open
  • Created 5 years ago
  • Reactions:5
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
bittnercommented, Mar 14, 2019

Alternatively, can we make Bandit a bit smarter in a way that it recognizes when assert is used in a test module, and not warn about it?

0reactions
mpascommented, Nov 3, 2022

I am facing the same issue, is there a way to exclude B101 in the /tests folder? I tried to use the assert_used but this does not seem to work.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found