a
    J5d/                     @   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y   dZY n0 zddlZd	ZW n ey   dZY n0 zddlZd	ZW n ey   dZY n0 zddlZd	ZW n ey   dZY n0 zddlZd	ZW n ey.   dZY n0 zddlZd	ZW n eyX   dZY n0 zddlZd	ZW n ey   dZY n0 zddlZd	ZW n ey   dZY n0 zddlZd	ZW n ey   dZY n0 g Zg dZg dZ dgZ!dgZ"dgZ#dgZ$dgZ%dgZ&dgZ'es$ee7 Zes2ee 7 Zes@ee!7 ZesNee"7 Zes\ee#7 Zesjee$7 Zesxee%7 Zesee&7 Zesee'7 Z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   M/var/www/html/django/DPS/env/lib/python3.9/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   s>   |  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)Z	getoptionpytestmarkskipkeywordsZ
add_marker)r   itemsZ	skip_slowitemr   r   r	   pytest_collection_modifyitems    s    

r   T)Zautousec                   C   sD  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 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 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 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 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 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d0d t jdtd1d t jdtd2d t jdtd3d t jdtd4d t jdtd5d t jdtd6d t jdtd7d t jdtd8d t jdtd9d 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dAd t jdtdBd t jdtdCd t jdtdDd t jdtdEd d S )FNignoreZk_nearest_neighbors)categorymessageZnumeric_mixing_matrixzOrdered.* is deprecatedz literal_stringizer is deprecatedz"literal_destringizer is deprecatedzis_string_like is deprecatedz
authority_matrixz
hub_matrixzdefault_opener is deprecatedzempty_generator is deprecatedzmake_str is deprecatedz"generate_unique_node is deprecatedz&context manager reversed is deprecatedz$This will return a generator in 3.0*Zbetweenness_centrality_sourceZedge_betweenesszthe matrix subclassZto_numpy_matrixZfrom_numpy_matrixznetworkx.pagerank_numpyznetworkx.pagerank_scipyZwrite_gpickleZread_gpickleZ	write_shpZread_shpZedges_from_lineZ
write_yamlZ	read_yamlzFilterAtlas.copyzFilterAdjacency.copyzFilterMultiAdjacency.copyzFilterMultiInner.copyZjit_dataZ	jit_graphZconsumeziterable is deprecatedz%
The function signature for cytoscapez
The `attrs` keywordZpreserve_random_statez`almost_equal`z`assert_nodes_equal`z`assert_edges_equal`z`assert_graphs_equal`znetworkx.hits_scipyznetworkx.hits_numpyz>google_matrix will return an np.ndarray instead of a np.matrixZbiadjacency_matrixZbethe_hessian_matrixZincidence_matrixZlaplacian_matrixZnormalized_laplacian_matrixZdirected_laplacian_matrixZ'directed_combinatorial_laplacian_matrixZmodularity_matrixZdirected_modularity_matrixZadjacency_matrixz#

The scipy.sparse array containersznetworkx.projectz
find_coresZattr_matrixz\n\nmake_small_.*Zto_numpy_recarrayinfoZto_tuplezThe create_using argumentznx.nx_pydotz+

The `attrs` keyword argument of node_link)warningsfilterwarningsDeprecationWarningPendingDeprecationWarningFutureWarningr   r   r   r	   set_warnings+   s   r   c                 C   s   t | d< d S )Nnx)networkx)Zdoctest_namespacer   r   r	   add_nx   s    r"   F).algorithms/approximation/traveling_salesman.pyz/algorithms/centrality/current_flow_closeness.py*algorithms/node_classification/__init__.pyzalgorithms/non_randomness.pyz"algorithms/shortest_paths/dense.pylinalg/bethehessianmatrix.pyzlinalg/laplacianmatrix.pyzutils/misc.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/node_classification/hmn.pyz%algorithms/node_classification/lgc.pyz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.pyzdrawing/nx_pylab.pyr&   zreadwrite/nx_yaml.pyzdrawing/nx_agraph.pyzdrawing/nx_pydot.pyzreadwrite/nx_shp.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_pygraphvizyamlZhas_yamlZpydotZ	has_pydotZogrZhas_ogrZsympyZ	has_sympyZcollect_ignoreZneeds_numpyZneeds_scipyZneeds_matplotlibZneeds_pandasZ
needs_yamlZneeds_pygraphvizZneeds_pydotZ	needs_ogrZneeds_sympyr   r   r   r	   <module>   s   

 R











