Skip to content

Commit e250ba3

Browse files
frozenbugsUbuntu
and
Ubuntu
authored
[Misc] Rename test_utils -> pytests_utils. (#5438)
* rename * sort * rename --------- Co-authored-by: Ubuntu <[email protected]>
1 parent fe3d29a commit e250ba3

37 files changed

+50
-50
lines changed

tests/go/test_model.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import dgl
22
import pytest
33
import torch
4-
from test_utils.graph_cases import get_cases
4+
from pytests_utils.graph_cases import get_cases
55
from dglgo.model import *
66

77

File renamed without changes.
File renamed without changes.
File renamed without changes.

tests/python/common/dataloading/test_dataloader.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
negative_sampler,
99
NeighborSampler,
1010
)
11-
from test_utils import parametrize_idtype
11+
from pytests_utils import parametrize_idtype
1212

1313

1414
def create_test_graph(idtype):

tests/python/common/function/test_basics.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import numpy as np
99
import scipy.sparse as ssp
1010
from dgl import DGLGraph
11-
from test_utils import parametrize_idtype
11+
from pytests_utils import parametrize_idtype
1212

1313
D = 5
1414
reduce_msg_shapes = set()

tests/python/common/ops/test_edge_softmax.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
import networkx as nx
1111
import numpy as np
1212
import pytest
13+
import pytests_utils
1314
import scipy.sparse as ssp
14-
import test_utils
1515
from dgl import DGLError
1616
from dgl.ops import edge_softmax
17+
from pytests_utils import get_cases, parametrize_idtype
1718
from scipy.sparse import rand
18-
from test_utils import get_cases, parametrize_idtype
1919

2020
edge_softmax_shapes = [(1,), (1, 3), (3, 4, 5)]
2121
rfuncs = {"sum": fn.sum, "max": fn.max, "min": fn.min, "mean": fn.mean}

tests/python/common/ops/test_ops.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
import pytest
99
import torch
1010
from dgl.ops import gather_mm, gsddmm, gspmm, segment_reduce
11-
from test_utils import parametrize_idtype
12-
from test_utils.graph_cases import get_cases
11+
from pytests_utils import parametrize_idtype
12+
from pytests_utils.graph_cases import get_cases
1313

1414
random.seed(42)
1515
np.random.seed(42)

tests/python/common/test_batch-graph.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import dgl
66
import numpy as np
7-
from test_utils import parametrize_idtype
7+
from pytests_utils import parametrize_idtype
88

99

1010
def tree1(idtype):

tests/python/common/test_batch-heterograph.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import dgl
66
import pytest
77
from dgl.base import ALL
8-
from test_utils import check_graph_equal, get_cases, parametrize_idtype
8+
from pytests_utils import check_graph_equal, get_cases, parametrize_idtype
99

1010

1111
def check_equivalence_between_heterographs(

tests/python/common/test_frame.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import dgl.ndarray as nd
88
import numpy as np
99
from dgl.frame import Column
10-
from test_utils import parametrize_idtype
10+
from pytests_utils import parametrize_idtype
1111

1212

1313
def test_column_subcolumn():

tests/python/common/test_heterograph-apply-edges.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
import networkx as nx
1111
import numpy as np
1212
import pytest
13+
import pytests_utils
1314
import scipy.sparse as ssp
14-
import test_utils
1515
from dgl import DGLError
16+
from pytests_utils import get_cases, parametrize_idtype
1617
from scipy.sparse import rand
17-
from test_utils import get_cases, parametrize_idtype
1818

1919
rfuncs = {"sum": fn.sum, "max": fn.max, "min": fn.min, "mean": fn.mean}
2020
fill_value = {"sum": 0, "max": float("-inf")}

tests/python/common/test_heterograph-kernel.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import networkx as nx
88
import numpy as np
99
import pytest
10-
from test_utils import get_cases, parametrize_idtype
10+
from pytests_utils import get_cases, parametrize_idtype
1111

1212

1313
def udf_copy_src(edges):

tests/python/common/test_heterograph-pickle.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
import dgl.function as fn
99
import networkx as nx
1010
import pytest
11+
import pytests_utils
1112
import scipy.sparse as ssp
12-
import test_utils
1313
from dgl.graph_index import create_graph_index
1414
from dgl.utils import toindex
15-
from test_utils import get_cases, parametrize_idtype
15+
from pytests_utils import get_cases, parametrize_idtype
1616
from utils import assert_is_identical, assert_is_identical_hetero
1717

1818

@@ -110,7 +110,7 @@ def _global_message_func(nodes):
110110
def test_pickling_graph(g, idtype):
111111
g = g.astype(idtype)
112112
new_g = _reconstruct_pickle(g)
113-
test_utils.check_graph_equal(g, new_g, check_feature=True)
113+
pytests_utils.check_graph_equal(g, new_g, check_feature=True)
114114

115115

116116
@unittest.skipIf(F._default_context_str == "gpu", reason="GPU not implemented")
@@ -142,7 +142,7 @@ def test_pickling_batched_heterograph():
142142

143143
bg = dgl.batch([g, g2])
144144
new_bg = _reconstruct_pickle(bg)
145-
test_utils.check_graph_equal(bg, new_bg)
145+
pytests_utils.check_graph_equal(bg, new_bg)
146146

147147

148148
@unittest.skipIf(

tests/python/common/test_heterograph-remove.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import dgl
44
import numpy as np
5-
from test_utils import parametrize_idtype
5+
from pytests_utils import parametrize_idtype
66

77

88
@parametrize_idtype

tests/python/common/test_heterograph-shared-memory.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import scipy.sparse as ssp
1313
from dgl.graph_index import create_graph_index
1414
from dgl.utils import toindex
15-
from test_utils import parametrize_idtype
15+
from pytests_utils import parametrize_idtype
1616

1717

1818
def create_test_graph(idtype):

tests/python/common/test_heterograph-specialization.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import dgl.function as fn
55
import numpy as np
66
import scipy.sparse as sp
7-
from test_utils import parametrize_idtype
7+
from pytests_utils import parametrize_idtype
88

99
D = 5
1010

tests/python/common/test_heterograph-update-all.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
import networkx as nx
1111
import numpy as np
1212
import pytest
13+
import pytests_utils
1314
import scipy.sparse as ssp
14-
import test_utils
1515
from dgl import DGLError
16+
from pytests_utils import get_cases, parametrize_idtype
1617
from scipy.sparse import rand
17-
from test_utils import get_cases, parametrize_idtype
1818

1919
rfuncs = {"sum": fn.sum, "max": fn.max, "min": fn.min, "mean": fn.mean}
2020
feat_size = 2

tests/python/common/test_heterograph.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
import networkx as nx
1111
import numpy as np
1212
import pytest
13+
import pytests_utils
1314
import scipy.sparse as ssp
14-
import test_utils
1515
from dgl import DGLError
16+
from pytests_utils import get_cases, parametrize_idtype
1617
from scipy.sparse import rand
17-
from test_utils import get_cases, parametrize_idtype
1818
from utils import assert_is_identical_hetero
1919

2020

@@ -2419,7 +2419,7 @@ def test_dtype_cast(idtype):
24192419
else:
24202420
g_cast = g.int()
24212421
assert g_cast.idtype == F.int32
2422-
test_utils.check_graph_equal(g, g_cast, check_idtype=False)
2422+
pytests_utils.check_graph_equal(g, g_cast, check_idtype=False)
24232423

24242424

24252425
def test_float_cast():

tests/python/common/test_homophily.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import backend as F
55

66
import dgl
7-
from test_utils import parametrize_idtype
7+
from pytests_utils import parametrize_idtype
88

99

1010
@unittest.skipIf(

tests/python/common/test_merge.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import backend as F
22

33
import dgl
4-
from test_utils import parametrize_idtype
4+
from pytests_utils import parametrize_idtype
55

66

77
@parametrize_idtype

tests/python/common/test_partition.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from dgl.distributed import graph_partition_book as gpb
66
from dgl.partition import NDArrayPartition
7-
from test_utils import parametrize_idtype
7+
from pytests_utils import parametrize_idtype
88

99

1010
@unittest.skipIf(

tests/python/common/test_propagate.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import dgl
66
import networkx as nx
77
import utils as U
8-
from test_utils import parametrize_idtype
8+
from pytests_utils import parametrize_idtype
99

1010

1111
def create_graph(idtype):

tests/python/common/test_readout.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
import networkx as nx
77
import numpy as np
88
import pytest
9-
from test_utils import parametrize_idtype
10-
from test_utils.graph_cases import get_cases
9+
from pytests_utils import parametrize_idtype
10+
from pytests_utils.graph_cases import get_cases
1111

1212

1313
@parametrize_idtype

tests/python/common/test_sparse_ops-csr.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import numpy as np
55
import pytest
66
import scipy.sparse as ssp
7-
from test_utils import parametrize_idtype
7+
from pytests_utils import parametrize_idtype
88

99
if F.backend_name == "pytorch":
1010
import torch

tests/python/common/test_subgraph.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import numpy as np
88
import pytest
99
import scipy.sparse as ssp
10-
from test_utils import parametrize_idtype
10+
from pytests_utils import parametrize_idtype
1111

1212
D = 5
1313

tests/python/common/test_traversal.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import networkx as nx
1111
import numpy as np
1212
import scipy.sparse as sp
13-
from test_utils import parametrize_idtype
13+
from pytests_utils import parametrize_idtype
1414

1515
np.random.seed(42)
1616

tests/python/common/transforms/test_functional-sort.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import pytest
1212
import scipy.sparse as ssp
1313
from dgl import DGLError
14-
from test_utils import parametrize_idtype
14+
from pytests_utils import parametrize_idtype
1515

1616

1717
def create_test_heterograph(num_nodes, num_adj, idtype):

tests/python/common/transforms/test_to_block.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
import dgl
2020
import dgl.partition
21-
from test_utils import parametrize_idtype
21+
from pytests_utils import parametrize_idtype
2222

2323

2424
@parametrize_idtype

tests/python/common/transforms/test_transform.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
import networkx as nx
2727
import numpy as np
2828
import pytest
29+
from pytests_utils import parametrize_idtype
30+
from pytests_utils.graph_cases import get_cases
2931
from scipy import sparse as spsp
30-
from test_utils import parametrize_idtype
31-
from test_utils.graph_cases import get_cases
3232

3333
D = 5
3434

tests/python/common/utils/test_filter.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import dgl
66
import numpy as np
77
from dgl.utils import Filter
8-
from test_utils import parametrize_idtype
8+
from pytests_utils import parametrize_idtype
99

1010

1111
def test_graph_filter():

tests/python/mxnet/test_nn.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
import pytest
1010
import scipy as sp
1111
from mxnet import autograd, gluon, nd
12-
from test_utils import parametrize_idtype
13-
from test_utils.graph_cases import (
12+
from pytests_utils import parametrize_idtype
13+
from pytests_utils.graph_cases import (
1414
get_cases,
1515
random_bipartite,
1616
random_dglgraph,

tests/python/pytorch/dataloading/test_dataloader.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import pytest
1212
import torch
1313
import torch.distributed as dist
14-
from test_utils import parametrize_idtype
14+
from pytests_utils import parametrize_idtype
1515

1616

1717
@pytest.mark.parametrize("batch_size", [None, 16])

tests/python/pytorch/geometry/test_geometry.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
from dgl import DGLError
99
from dgl.base import DGLWarning
1010
from dgl.geometry import farthest_point_sampler, neighbor_matching
11-
from test_utils import parametrize_idtype
12-
from test_utils.graph_cases import get_cases
11+
from pytests_utils import parametrize_idtype
12+
from pytests_utils.graph_cases import get_cases
1313

1414

1515
def test_fps():

tests/python/pytorch/mpops/test_edgewise.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import numpy as np
77
import pytest
88
import torch
9-
from test_utils import parametrize_idtype
9+
from pytests_utils import parametrize_idtype
1010

1111
random.seed(42)
1212
np.random.seed(42)

tests/python/pytorch/nn/test_nn.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
import scipy as sp
1313
import torch
1414
import torch as th
15-
from test_utils import parametrize_idtype
16-
from test_utils.graph_cases import (
15+
from pytests_utils import parametrize_idtype
16+
from pytests_utils.graph_cases import (
1717
get_cases,
1818
random_bipartite,
1919
random_dglgraph,

tests/python/tensorflow/test_nn.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010
import pytest
1111
import scipy as sp
1212
import tensorflow as tf
13-
from tensorflow.keras import layers
14-
from test_utils import parametrize_idtype
15-
from test_utils.graph_cases import (
13+
from pytests_utils import parametrize_idtype
14+
from pytests_utils.graph_cases import (
1615
get_cases,
1716
random_bipartite,
1817
random_dglgraph,
1918
random_graph,
2019
)
20+
from tensorflow.keras import layers
2121

2222

2323
def _AXWb(A, X, W, b):

0 commit comments

Comments
 (0)