Skip to content

tests: Fix invalid escape warning in BGP-LS test - #21829

Merged
donaldsharp merged 1 commit into
FRRouting:masterfrom
cscarpitta:bgp_ls_fix_invalid_escape_sequence_warning
May 1, 2026
Merged

tests: Fix invalid escape warning in BGP-LS test#21829
donaldsharp merged 1 commit into
FRRouting:masterfrom
cscarpitta:bgp_ls_fix_invalid_escape_sequence_warning

Conversation

@cscarpitta

Copy link
Copy Markdown
Contributor

Pytest reports a DeprecationWarning during collection of tests/topotests/bgp_link_state/test_bgp_link_state.py due to an invalid escape sequence in the module docstring.

test_bgp_link_state.py:6
  /home/user/frr/tests/topotests/bgp_link_state/test_bgp_link_state.py:6: DeprecationWarning: invalid escape sequence '\ '
    """

Fix this by converting the module docstring to a raw string literal (r"""...""").

Pytest reports a DeprecationWarning during collection of
tests/topotests/bgp_link_state/test_bgp_link_state.py due to an
invalid escape sequence in the module docstring.

```
test_bgp_link_state.py:6
  /home/user/frr/tests/topotests/bgp_link_state/test_bgp_link_state.py:6: DeprecationWarning: invalid escape sequence '\ '
    """
```

Fix this by converting the module docstring to a raw string literal
(`r"""..."""`).

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
@frrbot frrbot Bot added the tests Topotests, make check, etc label May 1, 2026
@greptile-apps

greptile-apps Bot commented May 1, 2026

Copy link
Copy Markdown

Greptile Summary

Converts the module docstring in test_bgp_link_state.py from a plain triple-quoted string to a raw string literal (r""") to suppress a Python DeprecationWarning about an invalid escape sequence ('\ ') during pytest collection. The change is minimal and correct.

Confidence Score: 5/5

This PR is safe to merge β€” it is a trivial one-character docstring fix with no behavioral impact.

Single-line change converting a plain docstring to a raw string literal. No logic, no data, no control flow is affected. The fix correctly addresses the reported DeprecationWarning.

No files require special attention.

Important Files Changed

Filename Overview
tests/topotests/bgp_link_state/test_bgp_link_state.py One-character fix: module docstring changed from """ to r""" to eliminate invalid escape sequence DeprecationWarning during pytest collection.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[pytest collects test_bgp_link_state.py] --> B{Docstring type?}
    B -->|Before: plain docstring| C[Python parses escape sequences]
    C --> D[DeprecationWarning: invalid escape backslash-space]
    B -->|After: raw r-docstring| E[Backslashes treated as literals]
    E --> F[Clean collection, no warnings]
Loading

Reviews (1): Last reviewed commit: "tests: Fix invalid escape warning in bgp..." | Re-trigger Greptile

@donaldsharp
donaldsharp merged commit b2c8604 into FRRouting:master May 1, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

master size/XS tests Topotests, make check, etc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants