Skip to content

Commit 38d3836

Browse files
authored
Apply suggestions from code review
1 parent f9d477a commit 38d3836

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

test/test_node.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
1-
"""Unit tests for the RemoteNode and LocalNode classes."""
21
import unittest
32

43
import canopen
5-
import canopen.network
6-
import canopen.objectdictionary
74

85

96
def count_subscribers(network: canopen.Network) -> int:
107
"""Count the number of subscribers in the network."""
11-
return sum(
12-
len(n) for n in network.subscribers.values()
13-
)
8+
return sum(len(n) for n in network.subscribers.values())
149

1510

1611
class TestLocalNode(unittest.TestCase):
17-
"""Unit tests for the LocalNode class."""
1812

1913
@classmethod
2014
def setUpClass(cls):
@@ -29,7 +23,6 @@ def tearDownClass(cls):
2923
cls.network.disconnect()
3024

3125
def test_associate_network(self):
32-
3326
# Need to store the number of subscribers before associating because the
3427
# network implementation automatically adds subscribers to the list
3528
n_subscribers = count_subscribers(self.network)
@@ -65,7 +58,6 @@ def test_associate_network(self):
6558

6659

6760
class TestRemoteNode(unittest.TestCase):
68-
"""Unittests for the RemoteNode class."""
6961

7062
@classmethod
7163
def setUpClass(cls):
@@ -80,7 +72,6 @@ def tearDownClass(cls):
8072
cls.network.disconnect()
8173

8274
def test_associate_network(self):
83-
8475
# Need to store the number of subscribers before associating because the
8576
# network implementation automatically adds subscribers to the list
8677
n_subscribers = count_subscribers(self.network)

0 commit comments

Comments
 (0)