@@ -24,32 +24,42 @@ measurement or reporting.
2424.. _warnings :
2525
2626Warnings
27- ........ 
27+ -------- 
2828
2929Warnings are issued for possible problems but don't stop the measurement or
3030reporting.  See below for the details of each warning, and how to suppress
3131warnings you don't need to see.
3232
33+ .. _warning_couldnt_parse :
34+ 
3335Couldn't parse Python file XXX (couldnt-parse)
3436  During reporting, a file was thought to be Python, but it couldn't be parsed
3537  as Python.
3638
39+ .. _warning_trace_changed :
40+ 
3741Trace function changed, data is likely wrong: XXX (trace-changed)
3842  Coverage measurement depends on a Python setting called the trace function.
3943  Other Python code in your product might change that function, which will
4044  disrupt coverage.py's measurement.  This warning indicates that has happened.
4145  The XXX in the message is the new trace function value, which might provide
4246  a clue to the cause.
4347
48+ .. _warning_module_not_python :
49+ 
4450Module XXX has no Python source (module-not-python)
4551  You asked coverage.py to measure module XXX, but once it was imported, it
4652  turned out not to have a corresponding .py file.  Without a .py file,
4753  coverage.py can't report on missing lines.
4854
55+ .. _warning_module_not_imported :
56+ 
4957Module XXX was never imported (module-not-imported)
5058  You asked coverage.py to measure module XXX, but it was never imported by
5159  your program.
5260
61+ .. _warning_no_data_collected :
62+ 
5363No data was collected (no-data-collected)
5464  Coverage.py ran your program, but didn't measure any lines as executed.
5565  This could be because you asked to measure only modules that never ran,
@@ -58,33 +68,45 @@ No data was collected (no-data-collected)
5868  To debug this problem, try using ``run --debug=trace `` to see the tracing
5969  decision made for each file.
6070
71+ .. _warning_module_not_measured :
72+ 
6173Module XXX was previously imported, but not measured (module-not-measured)
6274  You asked coverage.py to measure module XXX, but it had already been imported
6375  when coverage started.  This meant coverage.py couldn't monitor its
6476  execution.
6577
78+ .. _warning_already_imported :
79+ 
6680Already imported a file that will be measured: XXX (already-imported)
6781  File XXX had already been imported when coverage.py started measurement. Your
6882  setting for ``--source `` or ``--include `` indicates that you wanted to
6983  measure that file.  Lines will be missing from the coverage report since the
7084  execution during import hadn't been measured.
7185
86+ .. _warning_include_ignored :
87+ 
7288\-\- include is ignored because \-\- source is set (include-ignored)
7389  Both ``--include `` and ``--source `` were specified while running code.  Both
7490  are meant to focus measurement on a particular part of your source code, so
7591  ``--include `` is ignored in favor of ``--source ``.
7692
93+ .. _warning_dynamic_conflict :
94+ 
7795Conflicting dynamic contexts (dynamic-conflict)
7896  The ``[run] dynamic_context `` option is set in the configuration file, but
7997  something (probably a test runner plugin) is also calling the
8098  :meth: `.Coverage.switch_context ` function to change the context. Only one of
8199  these mechanisms should be in use at a time.
82100
101+ .. _warning_no_ctracer :
102+ 
83103Couldn't import C tracer (no-ctracer)
84104  The core tracer implemented in C should have been used, but couldn't be
85105  imported.  The reason is included in the warning message.  The Python tracer
86106  will be used instead.
87107
108+ .. _warning_no_sysmon :
109+ 
88110sys.monitoring isn't available in this version, using default core (no-sysmon)
89111  You requested to use the sys.monitoring measurement core, but are running on
90112  Python 3.11 or lower where it isn't available.  A default core will be used
@@ -100,6 +122,10 @@ sys.monitoring doesn't yet support dynamic contexts, using default core (no-sysm
100122  This isn't supported by coverage.py yet.  A default core will be used
101123  instead.
102124
125+ 
126+ Disabling warnings
127+ ------------------ 
128+ 
103129Individual warnings can be disabled with the :ref: `disable_warnings 
104130<config_run_disable_warnings>` configuration setting.  It is a list of the
105131short parenthetical nicknames in the warning messages.  For example, to silence
0 commit comments