methods <deprecated-aliases>` are also special-cased and, when the warning
filters are ``'default'`` or ``'always'``, they will appear only once
per-module, in order to avoid too many warning messages. This behavior can
- be overridden using the :option:`-Wd` or :option:`-Wa` options and leaving
+ be overridden using Python's :option:`!-Wd` or :option:`!-Wa` options
+ (see :ref:`Warning control <using-on-warnings>`) and leaving
*warnings* to ``None``.
.. versionchanged:: 3.2
The *warnings* argument specifies the :ref:`warning filter <warning-filter>`
that should be used while running the tests. If it's not specified, it will
- remain ``None`` if a :option:`-W` option is passed to :program:`python`,
+ remain ``None`` if a :option:`!-W` option is passed to :program:`python`
+ (see :ref:`Warning control <using-on-warnings>`),
otherwise it will be set to ``'default'``.
Calling ``main`` actually returns an instance of the ``TestProgram`` class.
See also :envvar:`PYTHONVERBOSE`.
+.. _using-on-warnings:
.. cmdoption:: -W arg
Warning control. Python's warning machinery by default prints warning
operators.
* Python 2.2 supports some command-line arguments for testing whether code will
- work with the changed division semantics. Running python with :option:`-Q
+ work with the changed division semantics. Running python with :option:`!-Q
warn` will cause a warning to be issued whenever division is applied to two
integers. You can use this to find code that's affected by the change and fix
it. By default, Python 2.2 will simply perform classic division without a
remaining compatible with existing code by not removing older features
or syntax. When it's not possible to do that, Python 2.6 tries to do
what it can, adding compatibility functions in a
-:mod:`future_builtins` module and a :option:`-3` switch to warn about
+:mod:`future_builtins` module and a :option:`!-3` switch to warn about
usages that will become unsupported in 3.0.
Some significant new packages have been added to the standard library,
compatible with 3.0 can do ``from future_builtins import hex, map`` as
necessary.
-A new command-line switch, :option:`-3`, enables warnings
+A new command-line switch, :option:`!-3`, enables warnings
about features that will be removed in Python 3.0. You can run code
with this switch to see how much work will be necessary to port
code to 3.0. The value of this switch is available
* :func:`operator.isCallable` and :func:`operator.sequenceIncludes`,
which are not supported in 3.x, now trigger warnings.
-* The :option:`-3` switch now automatically
- enables the :option:`-Qwarn <-Q>` switch that causes warnings
+* The :option:`!-3` switch now automatically
+ enables the :option:`!-Qwarn` switch that causes warnings
about using classic division with integers and long integers.