o
    8e                     @   s  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yE   dZY nw zddlZd	ZW n eyY   dZY nw zddlZd	ZW n eym   dZY nw zddlZd	ZW n ey   dZY nw zddlZd	ZW n ey   dZY nw zddlZd	ZW n ey   dZY nw zddlZd	ZW n ey   dZY nw g Zg dZg dZdgZdgZdgZdgZ dgZ!esee7 Zesee7 Zesee7 Zesee7 Zesee7 Zesee 7 Zesee!7 ZdS dS )ax  
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   AD:\Projects\ConvertPro\env\Lib\site-packages\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v 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/   sD   
r   c                 C   s   t | d< d S )Nnx)r   )Zdoctest_namespacer   r   r	   add_nxV   s   r!   F)	.algorithms/approximation/traveling_salesman.pyz/algorithms/centrality/current_flow_closeness.py!algorithms/node_classification.pyzalgorithms/non_randomness.pyz"algorithms/shortest_paths/dense.pylinalg/bethehessianmatrix.pyzlinalg/laplacianmatrix.pyzutils/misc.py"algorithms/centrality/laplacian.py)r"   z'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.pyr#   zalgorithms/similarity.pyconvert_matrix.pyzdrawing/layout.pyz"generators/spectral_graph_forge.pyzlinalg/algebraicconnectivity.pyzlinalg/attrmatrix.pyr$   zlinalg/graphmatrix.pyzlinalg/modularitymatrix.pyzlinalg/spectrum.pyzutils/rcm.pyr%   zdrawing/nx_pylab.pyr&   zdrawing/nx_agraph.pyzdrawing/nx_pydot.pyzalgorithms/polynomials.py)"__doc__sysr   r   r   r
   r   r   Zfixturer   r!   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    


&
