mirror of
https://github.com/PyCQA/flake8.git
synced 2026-03-29 10:36:53 +00:00
15 lines
469 B
Python
15 lines
469 B
Python
"""Integration tests for the legacy api."""
|
|
from __future__ import annotations
|
|
|
|
from flake8.api import legacy
|
|
|
|
|
|
def test_legacy_api(tmpdir):
|
|
"""A basic end-to-end test for the legacy api reporting errors."""
|
|
with tmpdir.as_cwd():
|
|
t_py = tmpdir.join("t.py")
|
|
t_py.write("import os # unused import\n")
|
|
|
|
style_guide = legacy.get_style_guide()
|
|
report = style_guide.check_files([t_py.strpath])
|
|
assert report.total_errors == 1
|