test_exceptions.py 927 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import pytest
  2. import networkx as nx
  3. # smoke tests for exceptions
  4. def test_raises_networkxexception():
  5. with pytest.raises(nx.NetworkXException):
  6. raise nx.NetworkXException
  7. def test_raises_networkxerr():
  8. with pytest.raises(nx.NetworkXError):
  9. raise nx.NetworkXError
  10. def test_raises_networkx_pointless_concept():
  11. with pytest.raises(nx.NetworkXPointlessConcept):
  12. raise nx.NetworkXPointlessConcept
  13. def test_raises_networkxalgorithmerr():
  14. with pytest.raises(nx.NetworkXAlgorithmError):
  15. raise nx.NetworkXAlgorithmError
  16. def test_raises_networkx_unfeasible():
  17. with pytest.raises(nx.NetworkXUnfeasible):
  18. raise nx.NetworkXUnfeasible
  19. def test_raises_networkx_no_path():
  20. with pytest.raises(nx.NetworkXNoPath):
  21. raise nx.NetworkXNoPath
  22. def test_raises_networkx_unbounded():
  23. with pytest.raises(nx.NetworkXUnbounded):
  24. raise nx.NetworkXUnbounded