()
| 72 | |
| 73 | @pytest.mark.skipif("FULL_TEST_SUITE" not in os.environ, reason="Run in nightly CI") |
| 74 | def test_border_cases(): |
| 75 | s1 = graphscope.session(cluster_type="hosts") |
| 76 | s2 = graphscope.session(cluster_type="hosts") |
| 77 | s3 = graphscope.session(cluster_type="hosts") |
| 78 | |
| 79 | s1.as_default() |
| 80 | assert graphscope.get_default_session() == s1 |
| 81 | |
| 82 | g3 = load_p2p_network(s3) |
| 83 | pg3 = g3.project(vertices={"host": ["id"]}, edges={"connect": ["dist"]}) |
| 84 | |
| 85 | with pytest.raises( |
| 86 | ValueError, |
| 87 | match="A default session is already active. You must explicitly call Session.close().", |
| 88 | ): |
| 89 | s2.as_default() |
| 90 | |
| 91 | s1.close() |
| 92 | |
| 93 | s2.as_default() |
| 94 | assert graphscope.get_default_session() == s2 |
| 95 | s2.close() |
| 96 | |
| 97 | s3.as_default() |
| 98 | assert graphscope.get_default_session() == s3 |
| 99 | sssp = graphscope.sssp(pg3, src=4) # ok, g3 belong to s3 |
| 100 | s3.close() |
| 101 | |
| 102 | |
| 103 | def test_with(): |
nothing calls this directly
no test coverage detected