Skip to content

Commit 6bf0fb5

Browse files
authored
Merge 7179137 into cbe79d1
2 parents cbe79d1 + 7179137 commit 6bf0fb5

File tree

2 files changed

+6
-27
lines changed

2 files changed

+6
-27
lines changed

docs/source/changes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ all releases are available on `PyPI <https://pypi.org/project/pytask>`_ and
1212

1313
- :gh:`217` enhances the tutorial on how to set up a project.
1414
- :gh:`218` removes ``depends_on`` and ``produces`` from the task function when parsed.
15+
- :gh:`219` removes some leftovers from pytest in :class:`~_pytask.mark.Mark`.
1516

1617

1718
0.1.8 - 2022-02-07

src/_pytask/mark/structures.py

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
from typing import Callable
66
from typing import Iterable
77
from typing import Mapping
8-
from typing import Optional
9-
from typing import Sequence
10-
from typing import Tuple
118

129
import attr
1310

@@ -16,25 +13,15 @@ def is_task_function(func: Any) -> bool:
1613
return callable(func) and getattr(func, "__name__", "<lambda>") != "<lambda>"
1714

1815

19-
@attr.s(frozen=True)
16+
@attr.s(frozen=True, auto_attribs=True)
2017
class Mark:
21-
name = attr.ib(type=str)
18+
name: str
2219
"""str: Name of the mark."""
23-
args = attr.ib(type=Tuple[Any, ...])
20+
args: tuple[Any, ...]
2421
"""Tuple[Any]: Positional arguments of the mark decorator."""
25-
kwargs = attr.ib(type=Mapping[str, Any])
22+
kwargs: Mapping[str, Any]
2623
"""Mapping[str, Any]: Keyword arguments of the mark decorator."""
2724

28-
_param_ids_from = attr.ib(type=Optional["Mark"], default=None, repr=False)
29-
"""Optional[Mark]: Source Mark for ids with parametrize Marks."""
30-
_param_ids_generated = attr.ib(
31-
type=Optional[Sequence[str]], default=None, repr=False
32-
)
33-
"""Optional[Sequence[str]]: Resolved/generated ids with parametrize Marks."""
34-
35-
def _has_param_ids(self) -> bool:
36-
return "ids" in self.kwargs or len(self.args) >= 4
37-
3825
def combined_with(self, other: Mark) -> Mark:
3926
"""Return a new Mark which is a combination of this Mark and another Mark.
4027
@@ -53,19 +40,10 @@ def combined_with(self, other: Mark) -> Mark:
5340
"""
5441
assert self.name == other.name
5542

56-
# Remember source of ids with parametrize Marks.
57-
param_ids_from: Mark | None = None
58-
if self.name == "parametrize":
59-
if other._has_param_ids():
60-
param_ids_from = other
61-
elif self._has_param_ids():
62-
param_ids_from = self
63-
6443
return Mark(
6544
self.name,
6645
self.args + other.args,
67-
dict(self.kwargs, **other.kwargs),
68-
param_ids_from=param_ids_from,
46+
{**self.kwargs, **other.kwargs},
6947
)
7048

7149

0 commit comments

Comments
 (0)