Skip to content

Commit 73c2332

Browse files
committed
typing: Add types for testtools.tags
Signed-off-by: Stephen Finucane <[email protected]>
1 parent 1177121 commit 73c2332

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ module = [
8787
"testtools.monkey",
8888
"testtools.run",
8989
"testtools.runtest",
90-
"testtools.tags",
9190
"testtools.testcase",
9291
"testtools.testresult.*",
9392
"testtools.testsuite",

testtools/tags.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
class TagContext:
77
"""A tag context."""
88

9-
def __init__(self, parent=None):
9+
def __init__(self, parent: "TagContext | None" = None) -> None:
1010
"""Create a new TagContext.
1111
1212
:param parent: If provided, uses this as the parent context. Any tags
@@ -18,11 +18,11 @@ def __init__(self, parent=None):
1818
if parent:
1919
self._tags.update(parent.get_current_tags())
2020

21-
def get_current_tags(self):
21+
def get_current_tags(self) -> set[str]:
2222
"""Return any current tags."""
2323
return set(self._tags)
2424

25-
def change_tags(self, new_tags, gone_tags):
25+
def change_tags(self, new_tags: set[str], gone_tags: set[str]) -> set[str]:
2626
"""Change the tags on this context.
2727
2828
:param new_tags: A set of tags to add to this context.

0 commit comments

Comments
 (0)