Skip to content

tests: fix some python and test syntax - #20905

Merged
Jafaral merged 1 commit into
FRRouting:masterfrom
mjstapp:fix_topo_escape_dot
Feb 24, 2026
Merged

tests: fix some python and test syntax#20905
Jafaral merged 1 commit into
FRRouting:masterfrom
mjstapp:fix_topo_escape_dot

Conversation

@mjstapp

@mjstapp mjstapp commented Feb 23, 2026

Copy link
Copy Markdown
Contributor

Fix a couple of python escape syntax warnings, and an unknown pytest mark - was seeing these reported in recent CI runs.

@frrbot frrbot Bot added bugfix tests Topotests, make check, etc labels Feb 23, 2026
@greptile-apps

greptile-apps Bot commented Feb 23, 2026

Copy link
Copy Markdown

Greptile Summary

Fixes Python syntax warnings in test files by correcting escape sequences and replacing an unregistered pytest mark.

  • Removes unnecessary backslash escapes in BGP extended community regex pattern (test_bgp_extcomm-list_delete.py)
  • Fixes backslash escaping in docstring ASCII diagram (test_wucmp_use_underlay.py)
  • Replaces pytest.mark.random_order(disabled=True) with pytest.mark.zebra (test_zebra_multiple_connected.py)

Note: The zebra marker is not currently registered in pytest.ini, which will still generate an "unknown mark" warning.

Confidence Score: 4/5

  • Safe to merge with one minor follow-up needed
  • Changes correctly fix Python syntax warnings. The regex pattern change should be verified through tests to ensure BGP extended community matching still works as expected. The zebra marker needs to be registered in pytest.ini to fully resolve warnings.
  • tests/topotests/zebra_multiple_connected/test_zebra_multiple_connected.py - requires zebra marker registration in pytest.ini

Important Files Changed

Filename Overview
tests/topotests/bgp_extcomm_list_delete/test_bgp_extcomm-list_delete.py Removes unnecessary backslash escapes from regex pattern to fix Python deprecation warnings
tests/topotests/wucmp_bgp_diamond/test_wucmp_use_underlay.py Fixes backslash escaping in docstring ASCII art to eliminate Python syntax warnings
tests/topotests/zebra_multiple_connected/test_zebra_multiple_connected.py Replaces unknown random_order pytest mark with valid zebra mark

Last reviewed commit: 09cc79f

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

from lib.topolog import logger

pytestmark = pytest.mark.random_order(disabled=True)
pytestmark = pytest.mark.zebra

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

zebra marker is not registered in tests/topotests/pytest.ini. Add zebra: Tests that run against ZEBRA to the markers list (around line 63) to prevent warnings about unknown marks

Prompt To Fix With AI
This is a comment left during a code review.
Path: tests/topotests/zebra_multiple_connected/test_zebra_multiple_connected.py
Line: 24

Comment:
`zebra` marker is not registered in `tests/topotests/pytest.ini`. Add `zebra: Tests that run against ZEBRA` to the markers list (around line 63) to prevent warnings about unknown marks

How can I resolve this? If you propose a fix, please make it concise.

Fix a couple of python escape syntax warnings, and an unknown
pytest mark.

Signed-off-by: Mark Stapp <mjs@cisco.com>
@mjstapp
mjstapp force-pushed the fix_topo_escape_dot branch from 09cc79f to 319955e Compare February 23, 2026 17:48
@mjstapp

mjstapp commented Feb 23, 2026

Copy link
Copy Markdown
Contributor Author

oof - quite right, no zebra test mark; removed it

@Jafaral

Jafaral commented Feb 24, 2026

Copy link
Copy Markdown
Member

@Mergifyio backport dev/10.6

@mergify

mergify Bot commented Feb 24, 2026

Copy link
Copy Markdown

backport dev/10.6

βœ… Backports have been created

Details

@Jafaral
Jafaral merged commit a951a98 into FRRouting:master Feb 24, 2026
18 checks passed
donaldsharp added a commit that referenced this pull request Feb 24, 2026
tests: fix some python and test syntax (backport #20905)
@mjstapp
mjstapp deleted the fix_topo_escape_dot branch March 2, 2026 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants