File: test_spec.py

package info (click to toggle)
dask.distributed 2022.12.1%2Bds.1-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 10,164 kB
  • sloc: python: 81,938; javascript: 1,549; makefile: 228; sh: 100
file content (24 lines) | stat: -rw-r--r-- 601 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from __future__ import annotations

from distributed.deploy.spec import ProcessInterface
from distributed.utils_test import gen_test


@gen_test()
async def test_address_default_none():
    async with ProcessInterface() as p:
        assert p.address is None


@gen_test()
async def test_child_address_persists():
    class Child(ProcessInterface):
        def __init__(self, address=None):
            self.address = address
            super().__init__()

    async with Child() as c:
        assert c.address is None

    async with Child("localhost") as c:
        assert c.address == "localhost"