fixing delete_dict function errors

This commit is contained in:
muassif 2021-08-13 15:18:11 +04:00 committed by GitHub
parent 9d7143dfdf
commit cdf2c7d7fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,9 +13,9 @@ def my_calc():
@pytest.fixture
def data_set(request):
dict = {'x':10, 'y':5}
def delete_dict():
del dict
request.addfinalizer(delete_dict)
def delete_dict(obj):
del obj
request.addfinalizer(lambda: delete_dict(dict))
return dict
def test_add(my_calc, data_set):