aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMicah Lee <micah@micahflee.com>2022-03-06 14:01:32 -0800
committerMicah Lee <micah@micahflee.com>2022-03-06 14:01:32 -0800
commit5ada415e8ea903b3b56f4e41b89d698fe9437039 (patch)
tree0087902f361bc97b47e469f410291514a3adf39a
parentb068e8385289d5363ea96e5614a48e0cd388bc55 (diff)
downloadonionshare-5ada415e8ea903b3b56f4e41b89d698fe9437039.tar.gz
onionshare-5ada415e8ea903b3b56f4e41b89d698fe9437039.zip
Switch from pytest.yield_fixture to just pytest.fixture, to remove warnings when running tests
-rw-r--r--desktop/tests/conftest.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/desktop/tests/conftest.py b/desktop/tests/conftest.py
index b17aa45c..891e5ccf 100644
--- a/desktop/tests/conftest.py
+++ b/desktop/tests/conftest.py
@@ -78,8 +78,7 @@ def temp_dir_1024(temp_dir):
return new_temp_dir
-# pytest > 2.9 only needs @pytest.fixture
-@pytest.yield_fixture
+@pytest.fixture
def temp_dir_1024_delete(temp_dir):
"""Create a temporary directory that has a single file of a
particular size (1024 bytes). The temporary directory (including
@@ -102,8 +101,7 @@ def temp_file_1024(temp_dir):
return tmp_file.name
-# pytest > 2.9 only needs @pytest.fixture
-@pytest.yield_fixture
+@pytest.fixture
def temp_file_1024_delete(temp_dir):
"""
Create a temporary file of a particular size (1024 bytes).
@@ -117,8 +115,7 @@ def temp_file_1024_delete(temp_dir):
yield tmp_file.name
-# pytest > 2.9 only needs @pytest.fixture
-@pytest.yield_fixture(scope="session")
+@pytest.fixture(scope="session")
def custom_zw():
zw = web.share_mode.ZipWriter(
common.Common(),
@@ -130,8 +127,7 @@ def custom_zw():
os.remove(zw.zip_filename)
-# pytest > 2.9 only needs @pytest.fixture
-@pytest.yield_fixture(scope="session")
+@pytest.fixture(scope="session")
def default_zw():
zw = web.share_mode.ZipWriter(common.Common())
yield zw