Skip to content
Open
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions pylint/testutils/functional/test_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ def module(self) -> str:
package = basename(self._directory)
return ".".join([package, self.base])

@property
def expected_output_base(self) -> str:
return join(self._directory, self.base + ".txt")

@property
def expected_output(self) -> str:
files = [
Expand Down
8 changes: 1 addition & 7 deletions pylint/testutils/lint_module_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,13 +250,7 @@ def check_messages(self) -> list[OutputLine]:
__tracebackhide__ = True # pylint: disable=unused-variable
modules_to_check = [self._test_file.source]
self._linter.check(modules_to_check)
expected_messages, _ = self._get_expected()
actual_messages, actual_output = self._get_actual()
assert (
expected_messages == actual_messages
), self.error_msg_for_unequal_messages(
actual_messages, expected_messages, actual_output
)
_, actual_output = self._get_actual()
return actual_output

def _runTest(self) -> None:
Expand Down
1 change: 1 addition & 0 deletions requirements_test_min.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ typing-extensions~=4.15
py~=1.11.0
pytest>=8.4,<10.0
pytest-benchmark~=5.1
pytest-remaster==0.0.5
pytest-timeout~=2.4
towncrier>=24.8,<26.0
requests
Expand Down
8 changes: 7 additions & 1 deletion tests/test_functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

from __future__ import annotations

import sys
from collections.abc import Iterator
from pathlib import Path
from typing import TYPE_CHECKING
Expand Down Expand Up @@ -67,5 +68,10 @@ def test_functional(
actual_output = lint_test.check_messages()

golden_master.check(
lint_test.serialize_output(actual_output), test_file.expected_output
lint_test.serialize_output(actual_output),
test_file.expected_output_base,
dimensions={
"version": f"{sys.version_info[0]}{sys.version_info[1]}",
"platform": sys.platform,
},
)
141 changes: 0 additions & 141 deletions tests/testutils/test_lint_module_output_update.py

This file was deleted.

Loading