Skip to content

Commit

Permalink
marks: put generic error message in correct scope
Browse files Browse the repository at this point in the history
  • Loading branch information
pbrezina committed Jan 31, 2024
1 parent 7317290 commit a089db0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pytest_mh/_private/marks.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,10 @@ def Create(cls, item: pytest.Function, mark: pytest.Mark) -> TopologyMark:
:raises ValueError:
:rtype: TopologyMark
"""
nodeid = item.parent.nodeid if item.parent is not None else ""
error = f"{nodeid}::{item.originalname}: invalid arguments for @pytest.mark.topology"

if not mark.args or len(mark.args) > 3:
nodeid = item.parent.nodeid if item.parent is not None else ""
error = f"{nodeid}::{item.originalname}: invalid arguments for @pytest.mark.topology"
raise ValueError(error)

# Constructor for KnownTopologyBase
Expand Down

0 comments on commit a089db0

Please sign in to comment.