diff --git a/bench/skip.py b/bench/skip.py index 25559cc271e..2fc8240e565 100644 --- a/bench/skip.py +++ b/bench/skip.py @@ -2,7 +2,6 @@ import pytest - SKIP = True diff --git a/setup.py b/setup.py index f5150243a64..89e48c6b579 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,6 @@ from setuptools import setup - # TODO: if py gets upgrade to >=1.6, # remove _width_of_current_line in terminal.py INSTALL_REQUIRES = [ diff --git a/src/_pytest/assertion/truncate.py b/src/_pytest/assertion/truncate.py index d19c8b61eee..69d6acdef80 100644 --- a/src/_pytest/assertion/truncate.py +++ b/src/_pytest/assertion/truncate.py @@ -12,7 +12,6 @@ import six - DEFAULT_MAX_LINES = 8 DEFAULT_MAX_CHARS = 8 * 80 USAGE_MSG = "use '-vv' to show" diff --git a/src/_pytest/deprecated.py b/src/_pytest/deprecated.py index 4afde69020a..6134ca77b33 100644 --- a/src/_pytest/deprecated.py +++ b/src/_pytest/deprecated.py @@ -16,7 +16,6 @@ from _pytest.warning_types import RemovedInPytest4Warning from _pytest.warning_types import UnformattedWarning - YIELD_TESTS = "yield tests were removed in pytest 4.0 - {name} will be ignored" diff --git a/src/_pytest/hookspec.py b/src/_pytest/hookspec.py index 3b6c9a7d15a..0641e3bc5ac 100644 --- a/src/_pytest/hookspec.py +++ b/src/_pytest/hookspec.py @@ -3,7 +3,6 @@ from _pytest.deprecated import PYTEST_LOGWARNING - hookspec = HookspecMarker("pytest") # ------------------------------------------------------------------------- diff --git a/src/_pytest/logging.py b/src/_pytest/logging.py index 7e906deab87..22db4430102 100644 --- a/src/_pytest/logging.py +++ b/src/_pytest/logging.py @@ -15,7 +15,6 @@ from _pytest.config import create_terminal_writer from _pytest.pathlib import Path - DEFAULT_LOG_FORMAT = "%(filename)-25s %(lineno)4d %(levelname)-8s %(message)s" DEFAULT_LOG_DATE_FORMAT = "%H:%M:%S" diff --git a/src/_pytest/main.py b/src/_pytest/main.py index 6e639d8727c..d8478d4fc51 100644 --- a/src/_pytest/main.py +++ b/src/_pytest/main.py @@ -24,7 +24,6 @@ from _pytest.outcomes import exit from _pytest.runner import collect_one_node - # exitcodes for the command line EXIT_OK = 0 EXIT_TESTSFAILED = 1 diff --git a/src/_pytest/mark/structures.py b/src/_pytest/mark/structures.py index c8a25d156f8..d65d8b9d806 100644 --- a/src/_pytest/mark/structures.py +++ b/src/_pytest/mark/structures.py @@ -12,7 +12,6 @@ from ..compat import NOTSET from _pytest.outcomes import fail - EMPTY_PARAMETERSET_OPTION = "empty_parameter_set_mark" diff --git a/src/_pytest/pathlib.py b/src/_pytest/pathlib.py index 5ecdd6026bc..5dd00e74fce 100644 --- a/src/_pytest/pathlib.py +++ b/src/_pytest/pathlib.py @@ -19,7 +19,6 @@ from .compat import PY36 - if PY36: from pathlib import Path, PurePath else: diff --git a/testing/code/test_source.py b/testing/code/test_source.py index fc5eaed0416..965838dae22 100644 --- a/testing/code/test_source.py +++ b/testing/code/test_source.py @@ -16,7 +16,6 @@ import pytest from _pytest._code import Source - astonly = pytest.mark.nothing failsonjython = pytest.mark.xfail("sys.platform.startswith('java')") diff --git a/testing/example_scripts/perf_examples/collect_stats/generate_folders.py b/testing/example_scripts/perf_examples/collect_stats/generate_folders.py index 94b3f013fd8..ff1eaf7d6bb 100644 --- a/testing/example_scripts/perf_examples/collect_stats/generate_folders.py +++ b/testing/example_scripts/perf_examples/collect_stats/generate_folders.py @@ -1,7 +1,6 @@ import argparse import pathlib - HERE = pathlib.Path(__file__).parent TEST_CONTENT = (HERE / "template_test.py").read_bytes() diff --git a/testing/test_resultlog.py b/testing/test_resultlog.py index 2c5175246d2..aba5713af52 100644 --- a/testing/test_resultlog.py +++ b/testing/test_resultlog.py @@ -12,7 +12,6 @@ from _pytest.resultlog import pytest_unconfigure from _pytest.resultlog import ResultLog - pytestmark = pytest.mark.filterwarnings("ignore:--result-log is deprecated") diff --git a/testing/test_warnings.py b/testing/test_warnings.py index 984aae027e4..1b4231edc5b 100644 --- a/testing/test_warnings.py +++ b/testing/test_warnings.py @@ -8,7 +8,6 @@ import pytest - WARNINGS_SUMMARY_HEADER = "warnings summary" diff --git a/tox.ini b/tox.ini index 16dbaed90a6..997e98c2c09 100644 --- a/tox.ini +++ b/tox.ini @@ -205,6 +205,14 @@ filterwarnings = # Do not cause SyntaxError for invalid escape sequences in py37. default:invalid escape sequence:DeprecationWarning pytester_example_dir = testing/example_scripts + [flake8] max-line-length = 120 ignore = E203,W503 + +[isort] +; This config mimics what reorder-python-imports does. +force_single_line = 1 +known_localfolder = pytest,_pytest +known_third_party = test_source,test_excinfo +force_alphabetical_sort_within_sections = 1