From ea002e5d942511fca5db4ac711f8ed4fb6881050 Mon Sep 17 00:00:00 2001 From: lguohan Date: Mon, 1 Jun 2020 16:48:22 -0700 Subject: [PATCH] [vstest]: unmark fixture for create/remove_dpb_config_file (#1307) Fixture "create_dpb_config_file" called directly. Fixtures are not meant to be called directly, but are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/latest/fixture.html for more information about fixtures, and https://docs.pytest.org/en/latest/deprecations.html#calling-fixtures-directly about how to update your code. Signed-off-by: Guohan Lu --- tests/conftest.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index e671cf66acb2..f761d9d7b66e 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1017,7 +1017,6 @@ def dvs_acl_manager(request, dvs): dvs.get_counters_db()) ##################### DPB fixtures ########################################### -@pytest.yield_fixture(scope="module") def create_dpb_config_file(dvs): cmd = "sonic-cfggen -j /etc/sonic/init_cfg.json -j /tmp/ports.json --print-data > /tmp/dpb_config_db.json" dvs.runcmd(['sh', '-c', cmd]) @@ -1026,7 +1025,6 @@ def create_dpb_config_file(dvs): cmd = "cp /tmp/dpb_config_db.json /etc/sonic/config_db.json" dvs.runcmd(cmd) -@pytest.yield_fixture(scope="module") def remove_dpb_config_file(dvs): cmd = "mv /etc/sonic/config_db.json.bak /etc/sonic/config_db.json" dvs.runcmd(cmd)