mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-08 22:04:17 +00:00
automatic: pyupgrade --py36-plus
This commit is contained in:
parent
8cc3fc01e8
commit
358ae85120
51 changed files with 185 additions and 149 deletions
|
|
@ -1,7 +1,7 @@
|
|||
"""Module that is off sys.path by default, for testing local-plugin-paths."""
|
||||
|
||||
|
||||
class ExtensionTestPlugin2(object):
|
||||
class ExtensionTestPlugin2:
|
||||
"""Extension test plugin in its own directory."""
|
||||
|
||||
name = 'ExtensionTestPlugin2'
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
"""Integration tests for the checker submodule."""
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
import pytest
|
||||
|
||||
from flake8 import checker
|
||||
|
|
@ -20,7 +21,7 @@ EXPECTED_RESULT_PHYSICAL_LINE = (
|
|||
)
|
||||
|
||||
|
||||
class PluginClass(object):
|
||||
class PluginClass:
|
||||
"""Simple file plugin class yielding the expected report."""
|
||||
|
||||
name = 'test'
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
"""Integration tests for the main entrypoint of flake8."""
|
||||
import json
|
||||
import os
|
||||
from unittest import mock
|
||||
|
||||
import mock
|
||||
import pytest
|
||||
|
||||
from flake8 import utils
|
||||
|
|
@ -280,13 +280,13 @@ def test_obtaining_args_from_sys_argv_when_not_explicity_provided(capsys):
|
|||
def test_cli_config_option_respected(tmp_path):
|
||||
"""Test --config is used."""
|
||||
config = tmp_path / "flake8.ini"
|
||||
config.write_text(u"""\
|
||||
config.write_text("""\
|
||||
[flake8]
|
||||
ignore = F401
|
||||
""")
|
||||
|
||||
py_file = tmp_path / "t.py"
|
||||
py_file.write_text(u"import os\n")
|
||||
py_file.write_text("import os\n")
|
||||
|
||||
_call_main(["--config", str(config), str(py_file)])
|
||||
|
||||
|
|
@ -294,13 +294,13 @@ ignore = F401
|
|||
def test_cli_isolated_overrides_config_option(tmp_path):
|
||||
"""Test --isolated overrides --config."""
|
||||
config = tmp_path / "flake8.ini"
|
||||
config.write_text(u"""\
|
||||
config.write_text("""\
|
||||
[flake8]
|
||||
ignore = F401
|
||||
""")
|
||||
|
||||
py_file = tmp_path / "t.py"
|
||||
py_file.write_text(u"import os\n")
|
||||
py_file.write_text("import os\n")
|
||||
|
||||
_call_main(["--isolated", "--config", str(config), str(py_file)], retv=1)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,11 @@
|
|||
"""Integration tests for plugin loading."""
|
||||
from flake8.main import application
|
||||
|
||||
|
||||
LOCAL_PLUGIN_CONFIG = 'tests/fixtures/config_files/local-plugin.ini'
|
||||
LOCAL_PLUGIN_PATH_CONFIG = 'tests/fixtures/config_files/local-plugin-path.ini'
|
||||
|
||||
|
||||
class ExtensionTestPlugin(object):
|
||||
class ExtensionTestPlugin:
|
||||
"""Extension test plugin."""
|
||||
|
||||
name = 'ExtensionTestPlugin'
|
||||
|
|
@ -24,7 +23,7 @@ class ExtensionTestPlugin(object):
|
|||
parser.add_option('--anopt')
|
||||
|
||||
|
||||
class ReportTestPlugin(object):
|
||||
class ReportTestPlugin:
|
||||
"""Report test plugin."""
|
||||
|
||||
name = 'ReportTestPlugin'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue