From 3a3c63956a7d2794f53635b87a46852277c8a9e9 Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Mon, 3 Feb 2020 22:06:15 -0500 Subject: [PATCH] removed unnecessary try/finally --- .../blockchain/test_transcoding.py | 21 +++++++------------ 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/tests/integration/blockchain/test_transcoding.py b/tests/integration/blockchain/test_transcoding.py index 3fec6cc33..47fe511c7 100644 --- a/tests/integration/blockchain/test_transcoding.py +++ b/tests/integration/blockchain/test_transcoding.py @@ -2,10 +2,9 @@ import logging import pathlib import time -import lbry.wallet # just to make the following line work: +from .test_claim_commands import ClaimTestCase from lbry.conf import TranscodeConfig from lbry.file_analysis import VideoFileAnalyzer -from .test_claim_commands import ClaimTestCase log = logging.getLogger(__name__) @@ -60,12 +59,9 @@ class TranscodeValidation(ClaimTestCase): self.assertEqual(self.video_file_webm, new_file_name) async def test_volume(self): - try: - self.conf.volume_analysis_time = 200 - with self.assertRaisesRegex(Exception, "lower than prime"): - await self.analyzer.verify_or_repair(True, False, self.video_file_name) - finally: - self.conf.volume_analysis_time = 0 + self.conf.volume_analysis_time = 200 + with self.assertRaisesRegex(Exception, "lower than prime"): + await self.analyzer.verify_or_repair(True, False, self.video_file_name) async def test_container(self): file_name = self.make_name("bad_container", ".avi") @@ -150,9 +146,6 @@ class TranscodeValidation(ClaimTestCase): self.assertEqual("ogg", extension) async def test_no_ffmpeg(self): - try: - self.conf.ffmpeg_folder = "I don't really exist/" - with self.assertRaisesRegex(Exception, "Unable to locate"): - await self.analyzer.verify_or_repair(True, False, self.video_file_name) - finally: - self.conf.ffmpeg_folder = "" + self.conf.ffmpeg_folder = "I don't really exist/" + with self.assertRaisesRegex(Exception, "Unable to locate"): + await self.analyzer.verify_or_repair(True, False, self.video_file_name)