From 39a65cc336e2d227cb37028f47c7c1ed58ce951d Mon Sep 17 00:00:00 2001 From: Xiang Song Date: Thu, 26 Sep 2024 13:27:04 -0700 Subject: [PATCH] Update --- tests/unit-tests/test_gsf.py | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/tests/unit-tests/test_gsf.py b/tests/unit-tests/test_gsf.py index 1f3e1d58d0..031017b886 100644 --- a/tests/unit-tests/test_gsf.py +++ b/tests/unit-tests/test_gsf.py @@ -12,6 +12,7 @@ Unit tests for gsf.py """ +import pytest from graphstorm.gsf import (create_builtin_node_decoder, create_builtin_edge_decoder, @@ -464,28 +465,16 @@ def test_check_graph_name(): # test with invalid graph name graph_name = "/graph_name" - invalid_name = False - try: + with pytest.raises(AssertionError): check_graph_name(graph_name) - except: - invalid_name = True - assert invalid_name graph_name = "|graph_name" - invalid_name = False - try: + with pytest.raises(AssertionError): check_graph_name(graph_name) - except: - invalid_name = True - assert invalid_name graph_name = "\graph_name" - invalid_name = False - try: + with pytest.raises(AssertionError): check_graph_name(graph_name) - except: - invalid_name = True - assert invalid_name if __name__ == '__main__': test_check_graph_name()