Skip to content

Commit

Permalink
add try/catch for python-louvain (#1842)
Browse files Browse the repository at this point in the history
added a catch for the test importing an uncommon module

Authors:
  - Brad Rees (https://github.com/BradReesWork)

Approvers:
  - Rick Ratzel (https://github.com/rlratzel)

URL: #1842
  • Loading branch information
BradReesWork authored Sep 24, 2021
1 parent 9191711 commit cad10a3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion python/cugraph/cugraph/tests/test_louvain.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,15 @@

with warnings.catch_warnings():
warnings.filterwarnings("ignore", category=DeprecationWarning)
import community
import networkx as nx

try:
import community
except ModuleNotFoundError:
pytest.exit("community module not found\n"
"The python-louvain module needs to be installed\n"
"please run `pip install python-louvain`")


print("Networkx version : {} ".format(nx.__version__))

Expand Down

0 comments on commit cad10a3

Please sign in to comment.