Skip to content

Commit

Permalink
[Fix] some out-of-date unittests (#586)
Browse files Browse the repository at this point in the history
* fix dist ut

* fix config & hub ut break due to mmdet faster-rcnn rename
  • Loading branch information
C1rN09 committed Oct 8, 2022
1 parent 89146a5 commit e73c4bf
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tests/data/config/py_config/test_get_external_cfg.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (c) OpenMMLab. All rights reserved.
_base_ = [
'mmdet::_base_/models/faster_rcnn_r50_fpn.py',
'mmdet::_base_/models/faster-rcnn_r50_fpn.py',
'mmdet::_base_/datasets/coco_detection.py',
'mmdet::_base_/schedules/schedule_1x.py',
'mmdet::_base_/default_runtime.py'
Expand Down
2 changes: 1 addition & 1 deletion tests/data/config/py_config/test_get_external_cfg2.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Copyright (c) OpenMMLab. All rights reserved.
_base_ = 'mmdet::faster_rcnn/faster_rcnn_r50_fpn_1x_coco.py'
_base_ = 'mmdet::faster_rcnn/faster-rcnn_r50_fpn_1x_coco.py'
2 changes: 1 addition & 1 deletion tests/data/config/py_config/test_get_external_cfg3.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (c) OpenMMLab. All rights reserved.
_base_ = [
'mmdet::_base_/models/faster_rcnn_r50_fpn.py',
'mmdet::_base_/models/faster-rcnn_r50_fpn.py',
'mmdet::_base_/datasets/coco_detection.py',
'mmdet::_base_/schedules/schedule_1x.py',
'mmdet::_base_/default_runtime.py',
Expand Down
2 changes: 1 addition & 1 deletion tests/test_config/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ def test_get_cfg_path_external(self):
filename = 'py_config/simple_config.py'
filename = osp.join(self.data_path, 'config', filename)

cfg_name = 'mmdet::faster_rcnn/faster_rcnn_r50_fpn_1x_coco.py'
cfg_name = 'mmdet::faster_rcnn/faster-rcnn_r50_fpn_1x_coco.py'
cfg_path, scope = Config._get_cfg_path(cfg_name, filename)
assert scope == 'mmdet'
osp.isfile(cfg_path)
Expand Down
1 change: 1 addition & 0 deletions tests/test_dist/test_dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,7 @@ def test_all_reduce_params(self):
]

data_gen = (item for item in data)
dist.all_reduce_params(data_gen, coalesce=coalesce, op=reduce_op)

if reduce_op == 'sum':
expected = (
Expand Down
2 changes: 1 addition & 1 deletion tests/test_hub/test_hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ def test_get_config():
def test_get_model():
# TODO compatible with downstream codebase.
DefaultScope.get_instance('test_get_model', scope_name='test_scope')
get_model('mmdet::faster_rcnn/faster_rcnn_r50_fpn_1x_coco.py')
get_model('mmdet::faster_rcnn/faster-rcnn_r50_fpn_1x_coco.py')
assert DefaultScope.get_current_instance().scope_name == 'test_scope'
DefaultScope._instance_dict.pop('test_get_model')

0 comments on commit e73c4bf

Please sign in to comment.