diff --git a/tools/python/defs.bzl b/tools/python/defs.bzl
index 5fa2a86..a375abf 100644
--- a/tools/python/defs.bzl
+++ b/tools/python/defs.bzl
@@ -251,7 +251,7 @@ def py_project(name=None,
     for src in test_srcs:
         if "test_" in src:
             py_pytest(
-                name=src.split("/")[-1],
+                name=src.split("/")[-1].replace(".py", ""),
                 srcs=[src] + [f for f in test_srcs if "test_" not in f],
                 deps=[lib_name] + (test_deps or []),
                 data=test_data,