Code Duplication    Length = 13-13 lines in 2 locations

tests/milvus_python_test/test_config.py 2 locations

@@ 706-718 (lines=13) @@
703
        with pytest.raises(Exception) as e:
704
            relpy = connect.set_config("gpu", "search_devices", "gpu0")
705
706
    @pytest.mark.skip(reason="overwrite config file is not supported in ci yet.")
707
    @pytest.mark.timeout(CONFIG_TIMEOUT)
708
    def test_set_search_devices_invalid_values(self, connect, collection):
709
        '''
710
        target: set search_devices
711
        method: call set_config with invalid child values
712
        expected: status not ok
713
        '''
714
        if str(connect._cmd("mode")) == "CPU":
715
            pytest.skip("Only support GPU mode")
716
        for i in [-1, "10", "gpu-1", "gpu0, gpu1", "gpu22,gpu44", "gpu10000", "gpu 0", "-gpu0"]:
717
            with pytest.raises(Exception) as e:
718
                relpy = connect.set_config("gpu", "search_devices", i)
719
720
    @pytest.mark.skip(reason="overwrite config file is not supported in ci yet.")
721
    @pytest.mark.timeout(CONFIG_TIMEOUT)
@@ 604-616 (lines=13) @@
601
            with pytest.raises(Exception) as e:
602
                relpy = connect.set_config("gpu." + config, "true")
603
604
    @pytest.mark.skip(reason="overwrite config file is not supported in ci yet.")
605
    @pytest.mark.timeout(CONFIG_TIMEOUT)
606
    def test_set_gpu_enable_invalid_values(self, connect, collection):
607
        '''
608
        target: set "enable" param
609
        method: call set_config with invalid child values
610
        expected: status not ok
611
        '''
612
        if str(connect._cmd("mode")) == "CPU":
613
            pytest.skip("Only support GPU mode")
614
        for i in [-1, -2, 100]:
615
            with pytest.raises(Exception) as e:
616
                relpy = connect.set_config("gpu.enable", i)
617
618
    @pytest.mark.skip(reason="overwrite config file is not supported in ci yet.")
619
    @pytest.mark.timeout(CONFIG_TIMEOUT)