Skip to content

assert_used skips change in 1.7.7 #1106

Open
@jonyscathe

Description

@jonyscathe

Describe the bug

Had pyproject.toml containing the following which worked fine in 1.7.6:

[tool.bandit.assert_used]
skips = [
  'src/tests/*_test.py',
]

This fails in 1.7.7 unless changed to:

[tool.bandit.assert_used]
skips = [
  './src/tests/*_test.py',
]

This new config works in 1.7.7, but not 1.7.6.

Given this was only a subminor release, I am assuming that this behaviour change was unintentional as I wouldn't think a subminor release should require a change to config files.

Reproduction steps

1. Have some test file located at src/tests/my_test.py with an assert
2. Have code snippet from above in pyproject.toml
3. Run bandit with 1.7.6 and 1.7.7

Expected behavior

Expect that config files shouldn't require modification on a subminor release.

Bandit version

1.7.6 (Default)

Python version

3.12 (Default)

Additional context

For some reason I cannot report a bandit verison of 1.7.7 in the bandit version dropdown box so have left that at 1.7.6.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions