From fbb93581498070272dd67c6e0afbca13cb89d5f3 Mon Sep 17 00:00:00 2001 From: Daniel Chimeno Date: Wed, 28 Mar 2018 19:25:03 +0200 Subject: [PATCH] Replaced 'python -Wall' with 'python -Wa'. --- docs/howto/upgrade-version.txt | 8 ++++---- .../contributing/writing-code/submitting-patches.txt | 2 +- docs/topics/testing/overview.txt | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/howto/upgrade-version.txt b/docs/howto/upgrade-version.txt index 9cd52d7a99..d5bfeff3eb 100644 --- a/docs/howto/upgrade-version.txt +++ b/docs/howto/upgrade-version.txt @@ -59,12 +59,12 @@ warnings before upgrading ensures that you're informed about areas of the code that need altering. In Python, deprecation warnings are silenced by default. You must turn them on -using the ``-Wall`` Python command line option or the :envvar:`PYTHONWARNINGS` +using the ``-Wa`` Python command line option or the :envvar:`PYTHONWARNINGS` environment variable. For example, to show warnings while running tests: .. console:: - $ python -Wall manage.py test + $ python -Wa manage.py test If you're not using the Django test runner, you may need to also ensure that any console output is not captured which would hide deprecation warnings. For @@ -72,7 +72,7 @@ example, if you use `py.test`: .. code-block:: console - $ PYTHONWARNINGS=all py.test tests --capture=no + $ PYTHONWARNINGS=always py.test tests --capture=no Resolve any deprecation warnings with your current version of Django before continuing the upgrade process. @@ -108,7 +108,7 @@ use the flag if you test your app manually using ``manage.py runserver``): .. console:: - $ python -Wall manage.py test + $ python -Wa manage.py test After you have run the tests, fix any failures. While you have the release notes fresh in your mind, it may also be a good time to take advantage of new diff --git a/docs/internals/contributing/writing-code/submitting-patches.txt b/docs/internals/contributing/writing-code/submitting-patches.txt index cbda36075d..15dd431229 100644 --- a/docs/internals/contributing/writing-code/submitting-patches.txt +++ b/docs/internals/contributing/writing-code/submitting-patches.txt @@ -175,7 +175,7 @@ the first release of Django that deprecates a feature (``A.B``) should raise a will be removed) when the deprecated feature is invoked. Assuming we have good test coverage, these warnings are converted to errors when :ref:`running the test suite ` with warnings enabled: -``python -Wall runtests.py``. Thus, when adding a ``RemovedInDjangoXXWarning`` +``python -Wa runtests.py``. Thus, when adding a ``RemovedInDjangoXXWarning`` you need to eliminate or silence any warnings generated when running the tests. The first step is to remove any use of the deprecated behavior by Django itself. diff --git a/docs/topics/testing/overview.txt b/docs/topics/testing/overview.txt index 357ec9d790..12efb381c7 100644 --- a/docs/topics/testing/overview.txt +++ b/docs/topics/testing/overview.txt @@ -128,7 +128,7 @@ be reported, and any test databases created by the run will not be destroyed. .. admonition:: Test with warnings enabled It's a good idea to run your tests with Python warnings enabled: - ``python -Wall manage.py test``. The ``-Wall`` flag tells Python to + ``python -Wa manage.py test``. The ``-Wa`` flag tells Python to display deprecation warnings. Django, like many other Python libraries, uses these warnings to flag when features are going away. It also might flag areas in your code that aren't strictly wrong but could benefit