U
    9vf                     @   sl  d Z ddlZddlZddlZddlZdd Zdd Zdd Zejd	d
dd Z	ejd	d
dd Z
zddlZd	ZW n ek
r   dZY nX zddlZd	ZW n ek
r   dZY nX zddlZd	ZW n ek
r   dZY nX zddlZd	ZW n ek
r   dZY nX zddlZd	ZW n ek
r8   dZY nX zddlZd	ZW n ek
rd   dZY nX zddlZd	ZW n ek
r   dZY nX g Zdddddddddg	Zddddddddd d!d"d#d$d%d&dd'd(d)d*d+d,dd-d.d/d0dgZd1gZd(gZd2gZd3gZ d4gZ!esee7 Zes"ee7 Zes0ee7 Zes>ee7 ZesLee7 ZesZee 7 Zeshee!7 ZdS )5ax  
Testing
=======

General guidelines for writing good tests:

- doctests always assume ``import networkx as nx`` so don't add that
- prefer pytest fixtures over classes with setup methods.
- use the ``@pytest.mark.parametrize``  decorator
- use ``pytest.importorskip`` for numpy, scipy, pandas, and matplotlib b/c of PyPy.
  and add the module to the relevant entries below.

    Nc                 C   s   | j ddddd d S )N	--runslow
store_trueFzrun slow tests)actiondefaulthelp)Z	addoption)parser r   5/tmp/pip-unpacked-wheel-_lngutwb/networkx/conftest.pypytest_addoption   s       r
   c                 C   s   |  dd d S )Nmarkerszslow: mark test as slow to run)Zaddinivalue_line)configr   r   r	   pytest_configure   s    r   c                 C   sL   t jj| | drd S tjjdd}|D ]}d|jkr.|	| q.d S )Nr   zneed --runslow option to run)reasonZslow)
networkxclassesbackendsZ_mark_testsZ	getoptionpytestmarkskipkeywordsZ
add_marker)r   itemsZ	skip_slowitemr   r   r	   pytest_collection_modifyitems    s    

r   T)Zautousec                   C   s   t jdtdd t jdtdd t jdtdd t jdtdd t jdtdd t jdtdd t jdtd	d t jdtd
d d S )Nignorez literal_stringizer is deprecated)categorymessagez"literal_destringizer is deprecatedzThe create_using argumentznx.nx_pydotz+

The `attrs` keyword argument of node_linkz'single_target_shortest_path_length willzshortest_path for all_pairsz
forest_str is deprecated)warningsfilterwarningsDeprecationWarningr   r   r   r	   set_warnings/   sP          r   c                 C   s   t | d< d S )NZnx)r   )Zdoctest_namespacer   r   r	   add_nxV   s    r    Fz.algorithms/approximation/traveling_salesman.pyz/algorithms/centrality/current_flow_closeness.pyz!algorithms/node_classification.pyzalgorithms/non_randomness.pyz"algorithms/shortest_paths/dense.pyzlinalg/bethehessianmatrix.pyzlinalg/laplacianmatrix.pyzutils/misc.pyz"algorithms/centrality/laplacian.pyz'algorithms/assortativity/correlation.pyz"algorithms/assortativity/mixing.pyz!algorithms/assortativity/pairs.pyzalgorithms/bipartite/matrix.pyz algorithms/bipartite/spectral.pyz1algorithms/centrality/current_flow_betweenness.pyz8algorithms/centrality/current_flow_betweenness_subset.pyz$algorithms/centrality/eigenvector.pyzalgorithms/centrality/katz.pyz%algorithms/centrality/second_order.pyz%algorithms/centrality/subgraph_alg.pyz!algorithms/communicability_alg.pyz$algorithms/link_analysis/hits_alg.pyz(algorithms/link_analysis/pagerank_alg.pyzalgorithms/similarity.pyzconvert_matrix.pyzdrawing/layout.pyz"generators/spectral_graph_forge.pyzlinalg/algebraicconnectivity.pyzlinalg/attrmatrix.pyzlinalg/graphmatrix.pyzlinalg/modularitymatrix.pyzlinalg/spectrum.pyzutils/rcm.pyzdrawing/nx_pylab.pyzdrawing/nx_agraph.pyzdrawing/nx_pydot.pyzalgorithms/polynomials.py)"__doc__sysr   r   r   r
   r   r   Zfixturer   r    ZnumpyZ	has_numpyImportErrorZscipyZ	has_scipyZ
matplotlibZhas_matplotlibZpandasZ
has_pandasZ
pygraphvizZhas_pygraphvizZpydotZ	has_pydotZsympyZ	has_sympyZcollect_ignoreZneeds_numpyZneeds_scipyZneeds_matplotlibZneeds_pandasZneeds_pygraphvizZneeds_pydotZneeds_sympyr   r   r   r	   <module>   s   

&








