Skip to content

Commit 5d63df5

Browse files
Fix unit tests
1 parent ae2344e commit 5d63df5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/unit/test_train.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ def fixture_training_env():
3131
env = MagicMock()
3232
env.current_host = 'algo-1'
3333
env.hosts = ['algo-1']
34+
env.master_hostname = 'algo-1'
3435
env.network_interface_name = 'eth0'
3536
tmp = tempfile.mkdtemp()
3637
os.makedirs(os.path.join(tmp, 'model'))
@@ -96,7 +97,7 @@ def test_environment(training_env):
9697

9798
# distributed training specific environment
9899
assert MASTER_PORT == os.environ['MASTER_PORT']
99-
assert training_env.hosts[0] == os.environ['MASTER_ADDR']
100+
assert training_env.master_hostname == os.environ['MASTER_ADDR']
100101

101102
# nccl specific environment
102103
assert training_env.network_interface_name == os.environ['NCCL_SOCKET_IFNAME']

0 commit comments

Comments
 (0)