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

[REF] tests: Support pdb to debug pylint checks #517

Merged
merged 1 commit into from
Jan 13, 2025
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
13 changes: 8 additions & 5 deletions tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,15 @@ def run_pylint(self, paths, extra_params: list | None = None, verbose=False, rcf

@staticmethod
def _run_pylint(args, out, reporter):
with _patch_streams(out):
with pytest.raises(SystemExit) as ctx_mgr:
with warnings.catch_warnings():
warnings.simplefilter("ignore")
with pytest.raises(SystemExit) as ctx_mgr:
with warnings.catch_warnings():
warnings.simplefilter("ignore")
if sys.gettrace() is None: # No pdb enabled
with _patch_streams(out):
Run(args, reporter=reporter)
else: # pdb enabled
Run(args, reporter=reporter)
return int(ctx_mgr.value.code)
return int(ctx_mgr.value.code)

def test_10_path_dont_exist(self):
"""test if path don't exist"""
Expand Down
Loading