#36479: Failing test for black formatter missing install simulation
-------------------------------+--------------------------------------
Reporter: Roelzkie | Owner: Roelzkie
Type: Bug | Status: assigned
Component: Uncategorized | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------+--------------------------------------
Comment (by Roelzkie):
Replying to [comment:5 Mike Edmunds]:
> Replying to [comment:3 Sarah Boyce]:
> > Mike would you be able to confirm this and that the PR fixes the
issue? (See from #36162 you might have a similar setup)
>
> I'm not able to reproduce the issue as reported. (But I'm on macOS 15.5
not 14.7. I'm not sure why that would make a difference. Looks like we're
both on Python 3.13.2.)
>
> {{{#!shell
> % python ./runtests.py
user_commands.tests.UtilsTests.test_run_formatters_handles_oserror_for_black_path
>
> Testing against Django installed in '~/dev/django/django' with up to 8
processes
> Found 1 test(s).
> System check identified no issues (0 silenced).
> .
> ----------------------------------------------------------------------
> Ran 1 test in 0.009s
>
> OK
>
> % sw_vers
> ProductName: macOS
> ProductVersion: 15.5
> BuildVersion: 24F74
>
> % uname -mrsv
> Darwin 24.5.0 Darwin Kernel Version 24.5.0: Tue Apr 22 19:48:46 PDT
2025; root:xnu-11417.121.6~2/RELEASE_ARM64_T8103 arm64
>
> % python --version
> Python 3.13.2
>
> % git rev-parse --short=7 HEAD
> 23529b6
> }}}
Thank you for checking. I'm not sure why it would break. I pulled again
from the latest main branch just to be sure, but the test still failed. I
also followed your commands to show more information.
{{{#!shell
$ python ./runtests.py
user_commands.tests.UtilsTests.test_run_formatters_handles_oserror_for_black_path
Testing against Django installed in '/Users/user1/django/django' with up
to 8 processes
Found 1 test(s).
System check identified no issues (0 silenced).
F
======================================================================
FAIL: test_run_formatters_handles_oserror_for_black_path
(user_commands.tests.UtilsTests.test_run_formatters_handles_oserror_for_black_path)
[FileNotFoundError]
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/user1/django/tests/user_commands/tests.py", line 584, in
test_run_formatters_handles_oserror_for_black_path
self.assertIn(exception.__qualname__, parsed_error)
~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'FileNotFoundError' not found in 'Formatters failed to
launch:Traceback (most recent call last):\n File
"/Users/user1/django/django/core/management/utils.py", line 175, in
run_formatters\n subprocess.run(\n ~~~~~~~~~~~~~~^\n
[black_path, "--fast", "--", *written_files],\n
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n
capture_output=True,\n ^^^^^^^^^^^^^^^^^^^^\n )\n ^\n File
"/Users/user1/.pyenv/versions/3.13.2/lib/python3.13/subprocess.py", line
569, in run\n with Popen(*popenargs, **kwargs) as process:\n
~~~~~^^^^^^^^^^^^^^^^^^^^^^\n File
"/Users/user1/.pyenv/versions/3.13.2/lib/python3.13/subprocess.py", line
1051, in __init__\n self._execute_child(args, executable, preexec_fn,
close_fds,\n
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n
pass_fds, cwd, env,\n ^^^^^^^^^^^^^^^^^^^\n
...<5 lines>...\n gid, gids, uid, umask,\n
^^^^^^^^^^^^^^^^^^^^^^\n start_new_session,
process_group)\n
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File
"/Users/user1/.pyenv/versions/3.13.2/lib/python3.13/subprocess.py", line
1987, in _execute_child\n raise child_exception_type(errno_num,
err_msg, err_filename)\nNotADirectoryError: [Errno 20] Not a directory:
\'nonexistent\'\n'
----------------------------------------------------------------------
Ran 1 test in 0.008s
FAILED (failures=1)
$ sw_vers
ProductName: macOS
ProductVersion: 14.7.2
BuildVersion: 23H311
$ uname -mrsv
Darwin 23.6.0 Darwin Kernel Version 23.6.0: Fri Nov 15 15:13:56 PST 2024;
root:xnu-10063.141.1.702.7~1/RELEASE_ARM64_T8103 arm64
$ python --version
Python 3.13.2
$ git rev-parse --short=7 HEAD
23529b6
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36479#comment:6>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/django-updates/01070197af6ad879-46026f23-c7ff-45cf-ac6d-864309635adf-000000%40eu-central-1.amazonses.com.