Skip to content

Commit ddb158f

Browse files
committed
Use a dataclass for HostSpec
1 parent f9b2f6f commit ddb158f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

testinfra/backend/base.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# limitations under the License.
1212

1313
import abc
14-
import collections
14+
import dataclasses
1515
import locale
1616
import logging
1717
import shlex
@@ -24,7 +24,13 @@
2424

2525
logger = logging.getLogger("testinfra")
2626

27-
HostSpec = collections.namedtuple("HostSpec", ["name", "port", "user", "password"])
27+
28+
@dataclasses.dataclass
29+
class HostSpec:
30+
name: str
31+
port: Optional[str]
32+
user: Optional[str]
33+
password: Optional[str]
2834

2935

3036
class CommandResult:

0 commit comments

Comments
 (0)