Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion tests/flake8_debug_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import ast
from typing import Tuple
from unittest.mock import patch

import pytest

Expand All @@ -10,7 +11,7 @@
BreakpointHookError,
PdbError,
)
from flake8_debug.plugin import NoDebug
from flake8_debug.plugin import DebugVisitor, NoDebug

pytestmark = pytest.mark.unit

Expand Down Expand Up @@ -118,3 +119,9 @@ def test_no_false_positive_on_arbitrary_object_breakpoint():

def test_no_false_positive_on_arbitrary_object_set_trace():
assert not _plugin_results('cursor.set_trace()')


def test_recursion_error_is_handled():
tree = ast.parse('x = 1')
with patch.object(DebugVisitor, 'visit', side_effect=RecursionError):
assert list(NoDebug(tree).run()) == []
Loading