diff --git a/requirements_test.txt b/requirements_test.txt index 82ff691db2..955c620062 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -3,7 +3,6 @@ coverage~=7.6 tbump~=6.11.0 contributors-txt>=1.0.0 pytest-cov~=5.0 -pytest-profiling~=1.7 pytest-xdist~=3.6 six # Type packages for mypy diff --git a/tests/profile/test_profile_against_externals.py b/tests/profile/test_profile_against_externals.py deleted file mode 100644 index b646ede901..0000000000 --- a/tests/profile/test_profile_against_externals.py +++ /dev/null @@ -1,58 +0,0 @@ -"""Profiles basic -jX functionality.""" - -# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html -# For details: https://github.com/pylint-dev/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/pylint-dev/pylint/blob/main/CONTRIBUTORS.txt - -# pylint: disable=missing-function-docstring - -from __future__ import annotations - -import os -import pprint -from pathlib import Path - -import pytest -from git.repo import Repo - -from pylint.testutils import GenericTestReporter as Reporter -from pylint.testutils._run import _Run as Run - - -def _get_py_files(scanpath: str) -> list[str]: - assert os.path.exists(scanpath), f"Dir not found {scanpath}" - - filepaths: list[str] = [] - for dirpath, dirnames, filenames in os.walk(scanpath): - dirnames[:] = [dirname for dirname in dirnames if dirname != "__pycache__"] - filepaths.extend( - [ - os.path.join(dirpath, filename) - for filename in filenames - if filename.endswith(".py") - ] - ) - return filepaths - - -@pytest.mark.skipif( - not os.environ.get("PYTEST_PROFILE_EXTERNAL", False), - reason="PYTEST_PROFILE_EXTERNAL, not set, assuming not a profile run", -) -@pytest.mark.parametrize( - "name,git_repo", [("numpy", "https://github.com/numpy/numpy.git")] -) -def test_run(tmp_path: Path, name: str, git_repo: str) -> None: - """Runs pylint against external sources.""" - checkoutdir = tmp_path / name - checkoutdir.mkdir() - Repo.clone_from(url=git_repo, to_path=checkoutdir, depth=1) - filepaths = _get_py_files(scanpath=str(checkoutdir)) - print(f"Have {len(filepaths)} files") - - runner = Run(filepaths, reporter=Reporter(), exit=False) - - print( - f"Had {len(filepaths)} files with {len(runner.linter.reporter.messages)} messages" - ) - pprint.pprint(runner.linter.reporter.messages) diff --git a/tox.ini b/tox.ini index 82ee65da37..e44d81759f 100644 --- a/tox.ini +++ b/tox.ini @@ -84,14 +84,3 @@ commands = --benchmark-autosave {toxinidir}/tests \ --benchmark-group-by="group" \ {posargs:} - -[testenv:profile_against_external] -setenv = - PYTEST_PROFILE_EXTERNAL = 1 -deps = - -r {toxinidir}/requirements_test.txt - gprof2dot -commands = - pytest --exitfirst \ - --profile-svg \ - {toxinidir}/tests/profile/test_profile_against_externals.py