Unverified Commit e250ba3d authored by Hongzhi (Steve), Chen's avatar Hongzhi (Steve), Chen Committed by GitHub
Browse files

[Misc] Rename test_utils -> pytests_utils. (#5438)



* rename

* sort

* rename

---------
Co-authored-by: default avatarUbuntu <ubuntu@ip-172-31-28-63.ap-northeast-1.compute.internal>
parent fe3d29ac
import dgl import dgl
import pytest import pytest
import torch import torch
from test_utils.graph_cases import get_cases from pytests_utils.graph_cases import get_cases
from dglgo.model import * from dglgo.model import *
......
...@@ -8,7 +8,7 @@ from dgl.dataloading import ( ...@@ -8,7 +8,7 @@ from dgl.dataloading import (
negative_sampler, negative_sampler,
NeighborSampler, NeighborSampler,
) )
from test_utils import parametrize_idtype from pytests_utils import parametrize_idtype
def create_test_graph(idtype): def create_test_graph(idtype):
......
...@@ -8,7 +8,7 @@ import networkx as nx ...@@ -8,7 +8,7 @@ import networkx as nx
import numpy as np import numpy as np
import scipy.sparse as ssp import scipy.sparse as ssp
from dgl import DGLGraph from dgl import DGLGraph
from test_utils import parametrize_idtype from pytests_utils import parametrize_idtype
D = 5 D = 5
reduce_msg_shapes = set() reduce_msg_shapes = set()
......
...@@ -10,12 +10,12 @@ import dgl.function as fn ...@@ -10,12 +10,12 @@ import dgl.function as fn
import networkx as nx import networkx as nx
import numpy as np import numpy as np
import pytest import pytest
import pytests_utils
import scipy.sparse as ssp import scipy.sparse as ssp
import test_utils
from dgl import DGLError from dgl import DGLError
from dgl.ops import edge_softmax from dgl.ops import edge_softmax
from pytests_utils import get_cases, parametrize_idtype
from scipy.sparse import rand from scipy.sparse import rand
from test_utils import get_cases, parametrize_idtype
edge_softmax_shapes = [(1,), (1, 3), (3, 4, 5)] edge_softmax_shapes = [(1,), (1, 3), (3, 4, 5)]
rfuncs = {"sum": fn.sum, "max": fn.max, "min": fn.min, "mean": fn.mean} rfuncs = {"sum": fn.sum, "max": fn.max, "min": fn.min, "mean": fn.mean}
......
...@@ -8,8 +8,8 @@ import numpy as np ...@@ -8,8 +8,8 @@ import numpy as np
import pytest import pytest
import torch import torch
from dgl.ops import gather_mm, gsddmm, gspmm, segment_reduce from dgl.ops import gather_mm, gsddmm, gspmm, segment_reduce
from test_utils import parametrize_idtype from pytests_utils import parametrize_idtype
from test_utils.graph_cases import get_cases from pytests_utils.graph_cases import get_cases
random.seed(42) random.seed(42)
np.random.seed(42) np.random.seed(42)
......
...@@ -4,7 +4,7 @@ import backend as F ...@@ -4,7 +4,7 @@ import backend as F
import dgl import dgl
import numpy as np import numpy as np
from test_utils import parametrize_idtype from pytests_utils import parametrize_idtype
def tree1(idtype): def tree1(idtype):
......
...@@ -5,7 +5,7 @@ import backend as F ...@@ -5,7 +5,7 @@ import backend as F
import dgl import dgl
import pytest import pytest
from dgl.base import ALL from dgl.base import ALL
from test_utils import check_graph_equal, get_cases, parametrize_idtype from pytests_utils import check_graph_equal, get_cases, parametrize_idtype
def check_equivalence_between_heterographs( def check_equivalence_between_heterographs(
......
...@@ -7,7 +7,7 @@ import dgl ...@@ -7,7 +7,7 @@ import dgl
import dgl.ndarray as nd import dgl.ndarray as nd
import numpy as np import numpy as np
from dgl.frame import Column from dgl.frame import Column
from test_utils import parametrize_idtype from pytests_utils import parametrize_idtype
def test_column_subcolumn(): def test_column_subcolumn():
......
...@@ -10,11 +10,11 @@ import dgl.function as fn ...@@ -10,11 +10,11 @@ import dgl.function as fn
import networkx as nx import networkx as nx
import numpy as np import numpy as np
import pytest import pytest
import pytests_utils
import scipy.sparse as ssp import scipy.sparse as ssp
import test_utils
from dgl import DGLError from dgl import DGLError
from pytests_utils import get_cases, parametrize_idtype
from scipy.sparse import rand from scipy.sparse import rand
from test_utils import get_cases, parametrize_idtype
rfuncs = {"sum": fn.sum, "max": fn.max, "min": fn.min, "mean": fn.mean} rfuncs = {"sum": fn.sum, "max": fn.max, "min": fn.min, "mean": fn.mean}
fill_value = {"sum": 0, "max": float("-inf")} fill_value = {"sum": 0, "max": float("-inf")}
......
...@@ -7,7 +7,7 @@ import dgl.function as fn ...@@ -7,7 +7,7 @@ import dgl.function as fn
import networkx as nx import networkx as nx
import numpy as np import numpy as np
import pytest import pytest
from test_utils import get_cases, parametrize_idtype from pytests_utils import get_cases, parametrize_idtype
def udf_copy_src(edges): def udf_copy_src(edges):
......
...@@ -8,11 +8,11 @@ import dgl ...@@ -8,11 +8,11 @@ import dgl
import dgl.function as fn import dgl.function as fn
import networkx as nx import networkx as nx
import pytest import pytest
import pytests_utils
import scipy.sparse as ssp import scipy.sparse as ssp
import test_utils
from dgl.graph_index import create_graph_index from dgl.graph_index import create_graph_index
from dgl.utils import toindex from dgl.utils import toindex
from test_utils import get_cases, parametrize_idtype from pytests_utils import get_cases, parametrize_idtype
from utils import assert_is_identical, assert_is_identical_hetero from utils import assert_is_identical, assert_is_identical_hetero
...@@ -110,7 +110,7 @@ def _global_message_func(nodes): ...@@ -110,7 +110,7 @@ def _global_message_func(nodes):
def test_pickling_graph(g, idtype): def test_pickling_graph(g, idtype):
g = g.astype(idtype) g = g.astype(idtype)
new_g = _reconstruct_pickle(g) new_g = _reconstruct_pickle(g)
test_utils.check_graph_equal(g, new_g, check_feature=True) pytests_utils.check_graph_equal(g, new_g, check_feature=True)
@unittest.skipIf(F._default_context_str == "gpu", reason="GPU not implemented") @unittest.skipIf(F._default_context_str == "gpu", reason="GPU not implemented")
...@@ -142,7 +142,7 @@ def test_pickling_batched_heterograph(): ...@@ -142,7 +142,7 @@ def test_pickling_batched_heterograph():
bg = dgl.batch([g, g2]) bg = dgl.batch([g, g2])
new_bg = _reconstruct_pickle(bg) new_bg = _reconstruct_pickle(bg)
test_utils.check_graph_equal(bg, new_bg) pytests_utils.check_graph_equal(bg, new_bg)
@unittest.skipIf( @unittest.skipIf(
......
...@@ -2,7 +2,7 @@ import backend as F ...@@ -2,7 +2,7 @@ import backend as F
import dgl import dgl
import numpy as np import numpy as np
from test_utils import parametrize_idtype from pytests_utils import parametrize_idtype
@parametrize_idtype @parametrize_idtype
......
...@@ -12,7 +12,7 @@ import networkx as nx ...@@ -12,7 +12,7 @@ import networkx as nx
import scipy.sparse as ssp import scipy.sparse as ssp
from dgl.graph_index import create_graph_index from dgl.graph_index import create_graph_index
from dgl.utils import toindex from dgl.utils import toindex
from test_utils import parametrize_idtype from pytests_utils import parametrize_idtype
def create_test_graph(idtype): def create_test_graph(idtype):
......
...@@ -4,7 +4,7 @@ import dgl ...@@ -4,7 +4,7 @@ import dgl
import dgl.function as fn import dgl.function as fn
import numpy as np import numpy as np
import scipy.sparse as sp import scipy.sparse as sp
from test_utils import parametrize_idtype from pytests_utils import parametrize_idtype
D = 5 D = 5
......
...@@ -10,11 +10,11 @@ import dgl.function as fn ...@@ -10,11 +10,11 @@ import dgl.function as fn
import networkx as nx import networkx as nx
import numpy as np import numpy as np
import pytest import pytest
import pytests_utils
import scipy.sparse as ssp import scipy.sparse as ssp
import test_utils
from dgl import DGLError from dgl import DGLError
from pytests_utils import get_cases, parametrize_idtype
from scipy.sparse import rand from scipy.sparse import rand
from test_utils import get_cases, parametrize_idtype
rfuncs = {"sum": fn.sum, "max": fn.max, "min": fn.min, "mean": fn.mean} rfuncs = {"sum": fn.sum, "max": fn.max, "min": fn.min, "mean": fn.mean}
feat_size = 2 feat_size = 2
......
...@@ -10,11 +10,11 @@ import dgl.function as fn ...@@ -10,11 +10,11 @@ import dgl.function as fn
import networkx as nx import networkx as nx
import numpy as np import numpy as np
import pytest import pytest
import pytests_utils
import scipy.sparse as ssp import scipy.sparse as ssp
import test_utils
from dgl import DGLError from dgl import DGLError
from pytests_utils import get_cases, parametrize_idtype
from scipy.sparse import rand from scipy.sparse import rand
from test_utils import get_cases, parametrize_idtype
from utils import assert_is_identical_hetero from utils import assert_is_identical_hetero
...@@ -2419,7 +2419,7 @@ def test_dtype_cast(idtype): ...@@ -2419,7 +2419,7 @@ def test_dtype_cast(idtype):
else: else:
g_cast = g.int() g_cast = g.int()
assert g_cast.idtype == F.int32 assert g_cast.idtype == F.int32
test_utils.check_graph_equal(g, g_cast, check_idtype=False) pytests_utils.check_graph_equal(g, g_cast, check_idtype=False)
def test_float_cast(): def test_float_cast():
......
...@@ -4,7 +4,7 @@ import unittest ...@@ -4,7 +4,7 @@ import unittest
import backend as F import backend as F
import dgl import dgl
from test_utils import parametrize_idtype from pytests_utils import parametrize_idtype
@unittest.skipIf( @unittest.skipIf(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment