[red-knot] Use unambiguous invalid-syntax-construct for suppression comment test (#15933)

## Summary

I experimented with [not trimming trailing newlines in code
snippets](https://github.com/astral-sh/ruff/pull/15926#discussion_r1940992090),
but since came to the conclusion that the current behavior is better
because otherwise, there is no way to write snippets without a trailing
newline at all. And when you copy the code from a Markdown snippet in
GitHub, you also don't get a trailing newline.

I was surprised to see some test failures when I played with this
though, and decided to make this test independent from this
implementation detail.
This commit is contained in:
David Peter 2025-02-04 15:24:50 +01:00 committed by GitHub
parent f23802e219
commit 24c1cf71cb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -77,7 +77,8 @@ def test(a: f"f-string type annotation", b: b"byte-string-type-annotation"): ...
```py
# error: [invalid-syntax]
# error: [unused-ignore-comment]
def test( # knot: ignore
def test($): # knot: ignore
pass
```
<!-- blacken-docs:on -->