관리-도구
편집 파일: commands.cpython-37.pyc
B .�Se� � @ s� d Z yddlmZ W n ek r0 d ZZY nNX ddlmZmZmZm Z m Z ddlmZ ddl mZ dd� ZG d d � d e�ZdS )a� nosetests setuptools command ---------------------------- The easiest way to run tests with nose is to use the `nosetests` setuptools command:: python setup.py nosetests This command has one *major* benefit over the standard `test` command: *all nose plugins are supported*. To configure the `nosetests` command, add a [nosetests] section to your setup.cfg. The [nosetests] section can contain any command line arguments that nosetests supports. The differences between issuing an option on the command line and adding it to setup.cfg are: * In setup.cfg, the -- prefix must be excluded * In setup.cfg, command line flags that take no arguments must be given an argument flag (1, T or TRUE for active, 0, F or FALSE for inactive) Here's an example [nosetests] setup.cfg section:: [nosetests] verbosity=1 detailed-errors=1 with-coverage=1 cover-package=nose debug=nose.loader pdb=1 pdb-failures=1 If you commonly run nosetests with a large number of options, using the nosetests setuptools command and configuring with setup.cfg can make running your tests much less tedious. (Note that the same options and format supported in setup.cfg are supported in all other config files, and the nosetests script will also load config files.) Another reason to run tests with the command is that the command will install packages listed in your `tests_require`, as well as doing a complete build of your package before running tests. For packages with dependencies or that build C extensions, using the setuptools command can be more convenient than building by hand and running the nosetests script. Bootstrapping ------------- If you are distributing your project and want users to be able to run tests without having to install nose themselves, add nose to the setup_requires section of your setup():: setup( # ... setup_requires=['nose>=1.0'] ) This will direct setuptools to download and activate nose during the setup process, making the ``nosetests`` command available. � )�CommandN)�Config�option_blacklist�user_config_files�flag�_bool)�TestProgram)�DefaultPluginManagerc C s� g }x|| j D ]r}|jd dd� tkr(q|jd dd� }|jdkrL|d }d}|jrh|jd dd� }|�|||jpxdf� qW |S )zAconvert a optparse option list into a distutils option tuple listr � N)� store_true�store_false�=� � )�option_list� _long_optsr �actionZ_short_opts�append�help)�parserZopt_list�optZ long_nameZ short_name� r �>/opt/alt/python37/lib/python3.7/site-packages/nose/commands.py�get_user_optionsI s r c @ sP e Zd ZdZee� e� d�Ze�� Z e e �Zdd� Zdd� Z dd� Zd d � ZdS )� nosetestszRun unit tests using nosetests)�filesZpluginsc C sV i | _ xD| jjD ]8}|jd dd� }|�dd�}|| j |<