Skip to content

Commit

Permalink
Explain why B904 is ignored in OOP test
Browse files Browse the repository at this point in the history
  • Loading branch information
edoardob90 committed Nov 18, 2024
1 parent edcfed5 commit 9bdfe5d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,14 @@ select = [

# Per-file rule ignores
[tool.ruff.lint.per-file-ignores]
"binder/ipython_config.py" = ["E266"] # Trailing whitespace in comment
"tutorial/tests/test_object_oriented_programming.py" = [
"B904",
] # suppress raise ... from err
# Trailing whitespace in comment
"binder/ipython_config.py" = ["E266"]
# suppress `raise ... from err`
# Why we ignore B904 from the object-oriented tests?
# We do want to raise an assertion error if the check on the solution function attributes fails,
# but Python by default will raise a TypeError via vars(solution_result)
# if the result is not a class and therefore doesn't have a __dict__ attribute.
"tutorial/tests/test_object_oriented_programming.py" = ["B904"]

# Ruff formatting
[tool.ruff.format]
Expand Down

0 comments on commit 9bdfe5d

Please sign in to comment.