Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[doc test helper] Better representation of failure for multiple bad files #9020

Conversation

Pierre-Sassoulas
Copy link
Member

Type of Changes

Type
βœ“ πŸ› Bug fix
βœ“ ✨ New feature

Description

This starts to check that there is a warning for each files in a bad directory, except if the message is in the list of expected message that need multiple file to create an example. Result:

E           AssertionError: There should be at least one warning raised for each file in '/home/pierre/pylint/doc/data/messages/n/non-ascii-file-name/bad' (3 total)
E             - Missing warning in /home/pierre/pylint/doc/data/messages/n/non-ascii-file-name/bad/__init__.py
E             'non-ascii-file-name' might need to be added in 'known_multiple_file_messages'.
E             
E             
E           assert 2 >= 3
E            +  where 2 = len([Message(msg_id='W2402', symbol='non-ascii-file-name', msg='File name "bΓ d" contains a non-ASCII character.', C='W', c...ascii-file-name/bad/not_bΓ©tter.py', module='bad.not_bΓ©tter', obj='', line=1, column=0, end_line=None, end_column=None)])
E            +  and   3 = len([PosixPath('/home/pierre/pylint/doc/data/messages/n/non-ascii-file-name/bad/bΓ d.py'), PosixPath('/home/pierre/pylint/d...ile-name/bad/not_bΓ©tter.py'), PosixPath('/home/pierre/pylint/doc/data/messages/n/non-ascii-file-name/bad/__init__.py')])

Also fix the existing problem (no need to have an __init__.py.

Blocked by #8991

@Pierre-Sassoulas Pierre-Sassoulas added Maintenance Discussion or action around maintaining pylint or the dev workflow Skip news πŸ”‡ This change does not require a changelog entry Blocked 🚧 Blocked by a particular issue labels Sep 9, 2023
@Pierre-Sassoulas Pierre-Sassoulas force-pushed the fix-multiple-bad-example-test-and-fail-message branch from 4b5fae9 to 8dffdb6 Compare September 9, 2023 21:28
@codecov
Copy link

codecov bot commented Sep 9, 2023

Codecov Report

Merging #9020 (8deecaa) into main (ee37544) will not change coverage.
The diff coverage is n/a.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #9020   +/-   ##
=======================================
  Coverage   95.75%   95.75%           
=======================================
  Files         173      173           
  Lines       18648    18648           
=======================================
  Hits        17856    17856           
  Misses        792      792           

DanielNoord
DanielNoord previously approved these changes Sep 10, 2023
self._test_file = test_file
self.multiple_file_messages = multiple_file_messages
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
self.multiple_file_messages = multiple_file_messages
self._multiple_file_messages = multiple_file_messages

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done and rebased ;)

@Pierre-Sassoulas Pierre-Sassoulas force-pushed the fix-multiple-bad-example-test-and-fail-message branch from 8dffdb6 to 8deecaa Compare September 10, 2023 12:28
@Pierre-Sassoulas Pierre-Sassoulas removed the Blocked 🚧 Blocked by a particular issue label Sep 10, 2023
@Pierre-Sassoulas Pierre-Sassoulas merged commit cfa4c7f into pylint-dev:main Sep 10, 2023
25 checks passed
@Pierre-Sassoulas Pierre-Sassoulas deleted the fix-multiple-bad-example-test-and-fail-message branch September 10, 2023 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Maintenance Discussion or action around maintaining pylint or the dev workflow Skip news πŸ”‡ This change does not require a changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants