• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ni / nixnet-python / #631999863

08 Apr 2025 07:22AM UTC coverage: 67.546% (-0.005%) from 67.551%
#631999863

Pull #302

travis-ci

Pull Request #302: Fix `tox -e mypy` errors with `mypy 1.14.1`

22 of 66 new or added lines in 15 files covered. (33.33%)

10 existing lines in 1 file now uncovered.

4712 of 6976 relevant lines covered (67.55%)

0.68 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

54.29
/nixnet/system/_collection.py
1
from collections.abc import Iterable
1✔
2
from collections.abc import Sized
1✔
3
import typing  # NOQA: F401
1✔
4

5
from nixnet import _cprops
1✔
6

7

1✔
8
class SystemCollection(Iterable, Sized):
1✔
UNCOV
9
    """Collection of System related objects."""
×
10

NEW
11
    def __init__(self, handle, prop_id, factory):
×
NEW
12
        # type: (int, int, typing.Any) -> None
×
13
        self._handle = handle
1✔
14
        self._prop_id = prop_id
15
        self._factory = factory
1✔
16

17
    def __repr__(self):
18
        return '{}(handle={})'.format(type(self).__name__, self._handle)
1✔
19

20
    def __eq__(self, other):
21
        if isinstance(other, self.__class__):
1✔
22
            sys_other = typing.cast(SystemCollection, other)
23
            return self._handle == sys_other._handle and self._prop_id == sys_other._prop_id
1✔
24
        else:
1✔
25
            return NotImplemented
1✔
26

27
    def __ne__(self, other):
1✔
UNCOV
28
        result = self.__eq__(other)
×
29
        if result is NotImplemented:
30
            return result
1✔
31
        else:
×
UNCOV
32
            return not result
×
33

×
34
    def __hash__(self):
UNCOV
35
        return hash(self._handle)
×
36

37
    def __len__(self):
1✔
38
        return _cprops.get_session_ref_array_len(self._handle, self._prop_id)
×
UNCOV
39

×
40
    def __iter__(self):
×
41
        for ref in _cprops.get_session_ref_array(self._handle, self._prop_id):
UNCOV
42
            yield self._factory(ref)
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc