#36680: Formatters run on `TemplateCommand` make `admin_scripts` tests brittle
-------------------------------------+-------------------------------------
               Reporter:  Natalia    |          Owner:  Natalia Bidart
  Bidart                             |
                   Type:  Bug        |         Status:  assigned
              Component:  Core       |        Version:  dev
  (Management commands)              |
               Severity:  Normal     |       Keywords:
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 Some `admin_scripts` tests, such as those for `startproject`, assert
 literal file contents generated from templates. Because `TemplateCommand`
 runs formatters before exiting (`run_formatters(...)`), the output can
 differ depending on environment details such as temporary directory path
 length or whether black is installed.

 For example, when `black` reformats long lines during parallel test runs,
 strings in the generated `manage.py` file are wrapped in parentheses,
 causing assertion failures.

 Tests should not depend on the exact output of formatters. Mocking or
 disabling them during test runs would make the suite more stable.
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36680>
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/0107019a0c42ab7b-a8528899-9a48-4b82-9e33-d7ad2ceeea16-000000%40eu-central-1.amazonses.com.

Reply via email to