Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

python_generation_mode project generating unnecesary/empty py_test #1690

Copy link
Copy link
Closed
@kpark-hrp

Description

@kpark-hrp
Issue body actions

🐞 bug report

Affected Rule

Gazelle with # gazelle:python_generation_mode project

The issue is caused by the rule:

Is this a regression?

Yes, the previous version in which this bug was not present was: 0.26.0

Description

A clear and concise description of the problem...

Since 0.27.0, having # gazelle:python_generation_mode project Gazelle directive is generating an empty py_test despite __test__.py not existing.

I believe it is related this change: #1538

For example,

py_test(
    name = "folder_test",
    imports = ["../.."],
    main = "__test__.py",
)

There isn't even a srcs parameter, so it doesn't even work.

🔬 Minimal Reproduction

  • A directory with Python files and a BUILD.bazel
    • No test files
    • No __test__.py
  • Add # gazelle:python_generation_mode project directive
  • Run Python Gazelle on that directory

🌍 Your Environment

  • Replicated on both MacOS and Ubuntu Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.