You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that tools like pylint use [pylint] <filename> as the header of failed tests:
It would be excellent if pytest-isort could do it similarly instead of using isort-check in each header and noting the filename in the first line as ERROR: <filename> Imports are incorrectly sorted..
The text was updated successfully, but these errors were encountered:
Interesting point, I checked other plugins I use and it seems like there is no "standard". pytest-black has a fixed string too, pytest-flake8 reports the ignored checks. I'm not sure if we should change it as it make break users code/infrastructure in case they check for the "isort-check" string in stdout. World is weird sometimes ;-)
def pytest_collection_modifyitems(config, items):
for item in items:
source = item.nodeid.split('::')[-1].lower()
if source in ['isort', 'mypy', 'pylint']:
item.reportinfo = unified_reportinfo(item=item, prefix=f'[{source}] ')
Works like magic! I wish there was a nicer way than parsing the nodeid, but I suppose you don't plan to change that anytime soon given that it may break things too.
It seems that tools like pylint use
[pylint] <filename>
as the header of failed tests:It would be excellent if pytest-isort could do it similarly instead of using
isort-check
in each header and noting the filename in the first line asERROR: <filename> Imports are incorrectly sorted.
.The text was updated successfully, but these errors were encountered: