Skip to content

Commit aae089f

Browse files
authored
Disable typing in py/private/pytest.py.tmpl (#577)
Disable type checking in generated code. This fixes a regression that occurred after upgrading to the latest version of the rules. There, our tooling started producing the following typing errors. ``` bazel-out/k8-fastbuild/bin/packages/cmk-agent-based/__test__.py:35: error: Cannot find implementation or library stub for module named "coverage" [import-not-found] bazel-out/k8-fastbuild/bin/packages/cmk-agent-based/__test__.py:35: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports bazel-out/k8-fastbuild/bin/packages/cmk-agent-based/__test__.py:37: error: Argument 1 to "open" has incompatible type "str | None"; expected "int | str | bytes | PathLike[str] | PathLike[bytes]" [arg-type] bazel-out/k8-fastbuild/bin/packages/cmk-agent-based/__test__.py:78: error: Argument 1 to "int" has incompatible type "str | None"; expected "str | Buffer | SupportsInt | SupportsIndex | SupportsTrunc" [arg-type] bazel-out/k8-fastbuild/bin/packages/cmk-agent-based/__test__.py:84: error: Argument 1 to "Path" has incompatible type "str | None"; expected "str | PathLike[str]" [arg-type] bazel-out/k8-fastbuild/bin/packages/cmk-agent-based/__test__.py:109: error: Unsupported left operand type for + ("None") [operator] bazel-out/k8-fastbuild/bin/packages/cmk-agent-based/__test__.py:109: note: Left operand is of type "str | None" bazel-out/k8-fastbuild/bin/packages/cmk-agent-based/__test__.py:114: error: Argument 1 to "open" has incompatible type "str | None"; expected "int | str | bytes | PathLike[str] | PathLike[bytes]" [arg-type] Found 6 errors in 1 file (checked 1 source file) ``` Related: * #428 --- ### Changes are visible to end-users: yes This patch fixes a regression.
1 parent 4518a9a commit aae089f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

py/private/pytest.py.tmpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
# type: ignore
16+
1517
import sys
1618
import os
1719
from pathlib import Path

0 commit comments

Comments
 (0)