Your IP : 216.73.216.213
B
N^�W�k � @ s� d Z ddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl
mZ ddlm
Z
mZ ddlmZ ddlmZ ddlmZmZmZ ee�ZG dd � d e�ZG d
d� de�Zdd
� Zdd� Zdd� Zedkr�ddlZeejdd� � dS )zCoverage data for coverage.py.� N)�env)�iitems�string_class)�_TEST_NAME_FILE)�PathAliases)�CoverageException�file_be_gone�isolate_modulec @ s e Zd ZdZd?dd�Zdd� Zdd� Zd d
� Zdd� Zd
d� Z dd� Z
dd� Zd@dd�Zdd� Z
e
Zdd� Zdd� ZdZedd� �Zedd � �Zed!d"� �Zd#d$� Zd%d&� Zd'd(� Zd)d*� Zd+d,� Zd-d.� Zd/d0� Zd1d2� ZdAd3d4�Zd5d6� Zd7d8� Z d9d:� Z!d;d<� Z"d=d>� Z#dS )B�CoverageDataa�
Manages collected coverage data, including file storage.
This class is the public supported API to the data coverage.py collects
during program execution. It includes information about what code was
executed. It does not include information from the analysis phase, to
determine what lines could have been executed, or what lines were not
executed.
.. note::
The file format is not documented or guaranteed. It will change in
the future, in possibly complicated ways. Do not read coverage.py
data files directly. Use this API to avoid disruption.
There are a number of kinds of data that can be collected:
* **lines**: the line numbers of source lines that were executed.
These are always available.
* **arcs**: pairs of source and destination line numbers for transitions
between source lines. These are only available if branch coverage was
used.
* **file tracer names**: the module names of the file tracer plugins that
handled each file in the data.
* **run information**: information about the program execution. This is
written during "coverage run", and then accumulated during "coverage
combine".
Lines, arcs, and file tracer names are stored for each source file. File
names in this API are case-sensitive, even on platforms with
case-insensitive file systems.
To read a coverage.py data file, use :meth:`read_file`, or
:meth:`read_fileobj` if you have an already-opened file. You can then
access the line, arc, or file tracer data with :meth:`lines`, :meth:`arcs`,
or :meth:`file_tracer`. Run information is available with
:meth:`run_infos`.
The :meth:`has_arcs` method indicates whether arc data is available. You
can get a list of the files in the data with :meth:`measured_files`.
A summary of the line data is available from :meth:`line_counts`. As with
most Python containers, you can determine if there is any data at all by
using this object as a boolean value.
Most data files will be created by coverage.py itself, but you can use
methods here to create data files if you like. The :meth:`add_lines`,
:meth:`add_arcs`, and :meth:`add_file_tracers` methods add data, in ways
that are convenient for coverage.py. The :meth:`add_run_info` method adds
key-value pairs to the run information.
To add a file without any measured data, use :meth:`touch_file`.
You write to a named file with :meth:`write_file`, or to an already opened
file with :meth:`write_fileobj`.
You can clear the data in memory with :meth:`erase`. Two data collections
can be combined by using :meth:`update` on one :class:`CoverageData`,
passing it the other.
Nc C s"