Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable individual tests #597

Merged
merged 3 commits into from
Feb 4, 2022

Commits on Feb 2, 2022

  1. support for disabling individual tests

    - allow disabling tests by id and by name (e.g. B602,assert_used)
    - update nosec_lines to be a dict keyed on line number to a set of tests to ignore
    - use an empty set to indicate a blanket nosec (i.e. just #nosec, no individual tests)
    - use None to indicate that there was no nosec comment on the line in question
    - track and report metrics on the number of tests skipped by specific tests and the number of tests that fail because they were not included in the list of specific tests to ignore
    
    Resolves PyCQA#211
    See also PyCQA#418
    mikespallino committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    bfa9288 View commit details
    Browse the repository at this point in the history
  2. update comment parsing

    - consolidating the test regex to limit the number of passes we need to make
    - use a regex to capture the nosec comment anchor rather than multiple find calls
    - remove unicode ellipses in example file
    - update docstring for clarity
    mikespallino committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    7fe51bb View commit details
    Browse the repository at this point in the history
  3. feedback

    - re.finditer -> compiled_obj.finditer
    - remove metric when using comment with specific tests to ingore and a different test fails
    - pass metrics from node_visitor to constructor of tester so we can just call the methods directly and not alter calls signatures or return types
    mikespallino committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    5747e30 View commit details
    Browse the repository at this point in the history