Skip to content

Commit

Permalink
[vstest]: unmark fixture for create/remove_dpb_config_file (sonic-net…
Browse files Browse the repository at this point in the history
…#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 <lguohan@gmail.com>
  • Loading branch information
lguohan committed Jun 1, 2020
1 parent e09dbc2 commit ea002e5
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand All @@ -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)
Expand Down

0 comments on commit ea002e5

Please sign in to comment.