Skip to content

Commit 03de3c0

Browse files
committed
example: improve basic test
note: on windows deps[:basic] in basic_test may fail while basic_lib_test work
1 parent 9017093 commit 03de3c0

File tree

1 file changed

+24
-7
lines changed

1 file changed

+24
-7
lines changed

examples/basic/BUILD.bazel

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,22 @@ pybind_extension(
88
srcs = ["basic.cpp"],
99
)
1010

11+
py_test(
12+
name = "basic_pybind_data_test",
13+
size="small",
14+
srcs = ["basic_test.py"],
15+
main = "basic_test.py",
16+
data = [":basic"],
17+
)
18+
19+
py_test(
20+
name = "basic_pybind_deps_test",
21+
size="small",
22+
srcs = ["basic_test.py"],
23+
main = "basic_test.py",
24+
deps = [":basic"],
25+
)
26+
1127
py_wheel(
1228
name = "basic_wheel",
1329
testonly = True,
@@ -22,17 +38,18 @@ py_library(
2238
imports = ["."],
2339
)
2440

41+
py_test(
42+
name = "basic_lib_test",
43+
size="small",
44+
srcs = ["basic_test.py"],
45+
main = "basic_test.py",
46+
deps = [":basic_lib"],
47+
)
48+
2549
py_wheel(
2650
name = "basic_lib_wheel",
2751
testonly = True,
2852
distribution = "basic_lib",
2953
version = "1.0.0",
3054
deps = [":basic_lib"],
3155
)
32-
33-
py_test(
34-
name = "basic_test",
35-
size="small",
36-
srcs = ["basic_test.py"],
37-
deps = [":basic_lib"],
38-
)

0 commit comments

Comments
 (0)