|
1 | 1 | import logging
|
2 | 2 | import os
|
| 3 | +from dataclasses import dataclass |
3 | 4 | from pathlib import Path
|
4 | 5 | from typing import Optional, cast
|
5 | 6 |
|
@@ -31,30 +32,16 @@ def test_contains_egg_info(s: str, expected: bool) -> None:
|
31 | 32 | assert result == expected
|
32 | 33 |
|
33 | 34 |
|
| 35 | +@dataclass |
34 | 36 | class ReqMock:
|
35 |
| - def __init__( |
36 |
| - self, |
37 |
| - name: str = "pendulum", |
38 |
| - is_wheel: bool = False, |
39 |
| - editable: bool = False, |
40 |
| - link: Optional[Link] = None, |
41 |
| - constraint: bool = False, |
42 |
| - source_dir: Optional[str] = "/tmp/pip-install-123/pendulum", |
43 |
| - use_pep517: bool = True, |
44 |
| - supports_pyproject_editable: bool = False, |
45 |
| - ) -> None: |
46 |
| - self.name = name |
47 |
| - self.is_wheel = is_wheel |
48 |
| - self.editable = editable |
49 |
| - self.link = link |
50 |
| - self.constraint = constraint |
51 |
| - self.source_dir = source_dir |
52 |
| - self.use_pep517 = use_pep517 |
53 |
| - self._supports_pyproject_editable = supports_pyproject_editable |
54 |
| - |
55 |
| - @property |
56 |
| - def supports_pyproject_editable(self) -> bool: |
57 |
| - return self._supports_pyproject_editable |
| 37 | + name: str = "pendulum" |
| 38 | + is_wheel: bool = False |
| 39 | + editable: bool = False |
| 40 | + link: Optional[Link] = None |
| 41 | + constraint: bool = False |
| 42 | + source_dir: Optional[str] = "/tmp/pip-install-123/pendulum" |
| 43 | + use_pep517: bool = True |
| 44 | + supports_pyproject_editable: bool = False |
58 | 45 |
|
59 | 46 |
|
60 | 47 | @pytest.mark.parametrize(
|
|
0 commit comments