﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
36697	black need to be installed to launch the full test suite and it's not in the requirements	Pierre Sassoulas		"When first starting to contribute to django, 205 test errors out (FAILED (errors=205, skipped=1827, expected failures=5)
) with the following stacktrace:



{{{
ERROR: test_makemessages_no_settings (i18n.test_extraction.NoSettingsExtractionTests.test_makemessages_no_settings)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ""/home/pierre/.local/share/uv/python/cpython-3.13.1-linux-x86_64-gnu/lib/python3.13/unittest/case.py"", line 58, in testPartExecutor
    yield
  File ""/home/pierre/.local/share/uv/python/cpython-3.13.1-linux-x86_64-gnu/lib/python3.13/unittest/case.py"", line 651, in run
    self._callTestMethod(testMethod)
    
  File ""/home/pierre/.local/share/uv/python/cpython-3.13.1-linux-x86_64-gnu/lib/python3.13/unittest/case.py"", line 606, in _callTestMethod
    if method() is not None:
    ^^^^^^^^^^^^^^^
  File ""/home/pierre/git/django/tests/i18n/test_extraction.py"", line 1131, in test_makemessages_no_settings
    out, err = self.run_django_admin([""makemessages"", ""-l"", ""en"", ""-v"", ""0""])
    ^^^^^^^^^^^^^^^
  File ""/home/pierre/git/django/tests/admin_scripts/tests.py"", line 167, in run_django_admin
    return self.run_test(
    ^^^^^^^^^^^^^^^
  File ""/home/pierre/git/django/tests/admin_scripts/tests.py"", line 152, in run_test
    test_environ[""PATH""] = self.path_without_formatters
    ^^^^^^^^^^^
  File ""/home/pierre/git/django/django/utils/functional.py"", line 47, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
    ^^^^^^^^^^^^^^^
  File ""/home/pierre/git/django/tests/admin_scripts/tests.py"", line 123, in path_without_formatters
    if os.path.commonpath([path_component, formatter_path]) == os.sep
    ^^^^^^^
  File ""<frozen posixpath>"", line 536, in commonpath
TypeError: expected str, bytes or os.PathLike object, not NoneType
}}}



When find_formatters return a black_path that is None (shutil.which(""black"") is None, meaning black is not installed).

I suggest raising a better error message by catching this in find_formatters directly and/or adding black to tests/requirements/py3.py."	Cleanup/optimization	closed	Core (Management commands)	dev	Normal	fixed	tests, black, contributing	Pierre Sassoulas	Accepted	0	0	0	0	0	0
