From c76889dd552e65f46d5f61cbca7f11dc4a6e4674 Mon Sep 17 00:00:00 2001 From: Petr Kalis Date: Mon, 9 Aug 2021 12:25:19 +0200 Subject: [PATCH] Hound --- tests/lib/db_handler.py | 2 +- tests/lib/file_handler.py | 4 +--- tests/lib/testing_wrapper.py | 1 - .../modules/sync_server/test_site_operations.py | 12 ++++++------ 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/tests/lib/db_handler.py b/tests/lib/db_handler.py index 97e69d9bd0..44f3e80f98 100644 --- a/tests/lib/db_handler.py +++ b/tests/lib/db_handler.py @@ -52,7 +52,7 @@ class DBHandler: raise RuntimeError( "Backup folder {} doesn't exist".format(sql_dir)) - for (dirpath, dirnames, filenames) in os.walk(sql_dir): + for (_dirpath, _dirnames, filenames) in os.walk(sql_dir): for file_name in filenames: sql_url = os.path.join(dirpath, file_name) query = self._import_query(self.uri, sql_url, diff --git a/tests/lib/file_handler.py b/tests/lib/file_handler.py index 5d7e64b9cd..4c769620a0 100644 --- a/tests/lib/file_handler.py +++ b/tests/lib/file_handler.py @@ -148,8 +148,7 @@ class RemoteFileHandler: RemoteFileHandler._save_response_content( itertools.chain((first_chunk, ), - response_content_generator), - fpath) + response_content_generator), fpath) response.close() @staticmethod @@ -260,4 +259,3 @@ class RemoteFileHandler: return None return match.group("id") - diff --git a/tests/lib/testing_wrapper.py b/tests/lib/testing_wrapper.py index 75ac476dfc..373bd9af0b 100644 --- a/tests/lib/testing_wrapper.py +++ b/tests/lib/testing_wrapper.py @@ -31,7 +31,6 @@ class TestCase: yield m m.undo() - @pytest.fixture(scope="module") def download_test_data(self): tmpdir = tempfile.mkdtemp() diff --git a/tests/unit/openpype/modules/sync_server/test_site_operations.py b/tests/unit/openpype/modules/sync_server/test_site_operations.py index 7dba792965..85e52bf5df 100644 --- a/tests/unit/openpype/modules/sync_server/test_site_operations.py +++ b/tests/unit/openpype/modules/sync_server/test_site_operations.py @@ -31,12 +31,12 @@ class TestSiteOperation(TestCase): @pytest.mark.usefixtures("db") def test_project_created(self, db): assert ['test_project'] == db.database.collection_names(False) - + @pytest.mark.usefixtures("db") def test_objects_imported(self, db): count_obj = len(list(db.database[self.TEST_PROJECT_NAME].find({}))) assert 15 == count_obj - + @pytest.mark.usefixtures("setup_sync_server_module") def test_add_site(self, db, setup_sync_server_module): """Adds 'test_site', checks that added, @@ -62,7 +62,7 @@ class TestSiteOperation(TestCase): ret = ret.pop() site_names = [site["name"] for site in ret["files"][0]["sites"]] assert 'test_site' in site_names, "Site name wasn't added" - + @pytest.mark.usefixtures("setup_sync_server_module") def test_add_site_again(self, db, setup_sync_server_module): """Depends on test_add_site, must throw exception.""" @@ -70,7 +70,7 @@ class TestSiteOperation(TestCase): setup_sync_server_module.add_site(self.TEST_PROJECT_NAME, self.REPRESENTATION_ID, site_name='test_site') - + @pytest.mark.usefixtures("setup_sync_server_module") def test_add_site_again_force(self, db, setup_sync_server_module): """Depends on test_add_site, must not throw exception.""" @@ -86,14 +86,14 @@ class TestSiteOperation(TestCase): assert 1 == len(ret), \ "Single {} must be in DB".format(self.REPRESENTATION_ID) - + @pytest.mark.usefixtures("setup_sync_server_module") def test_remove_site(self, db, setup_sync_server_module): """Depends on test_add_site, must remove 'test_site'.""" setup_sync_server_module.remove_site(self.TEST_PROJECT_NAME, self.REPRESENTATION_ID, site_name='test_site') - + query = { "_id": ObjectId(self.REPRESENTATION_ID) }