Skip to content

Commit

Permalink
Avoid running eval for simple cases
Browse files Browse the repository at this point in the history
  • Loading branch information
delfick committed May 4, 2024
1 parent 94f19e2 commit 7c561d5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pytest_mypy_plugins/definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,14 @@ def from_yaml(cls, data: List[Mapping[str, object]], *, is_closed: bool = False)

@property
def _skipped(self) -> bool:
return eval(str(self.skip), {"sys": sys, "os": os, "pytest": pytest, "platform": platform})
if isinstance(self.skip, bool):
return self.skip
elif self.skip == "True":
return True
elif self.skip == "False":
return False
else:
return eval(self.skip, {"sys": sys, "os": os, "pytest": pytest, "platform": platform})

@property
def test_name(self) -> str:
Expand Down

0 comments on commit 7c561d5

Please sign in to comment.