comparison env/lib/python3.9/site-packages/networkx/utils/tests/test_contextmanager.py @ 0:4f3585e2f14b draft default tip

"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
author shellac
date Mon, 22 Mar 2021 18:12:50 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:4f3585e2f14b
1 import networkx as nx
2
3
4 def test_reversed():
5 G = nx.DiGraph()
6 G.add_edge("A", "B")
7
8 # no exception
9 with nx.utils.reversed(G):
10 pass
11 assert "B" in G["A"]
12
13 # exception
14 try:
15 with nx.utils.reversed(G):
16 raise Exception
17 except:
18 assert "B" in G["A"]