[pitivi] common: Fix broken decorator
- From: Alexandru Băluț <alexbalut src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] common: Fix broken decorator
- Date: Sat, 17 Apr 2021 22:00:19 +0000 (UTC)
commit 0d3fe6fa72558c9348db1b4ccf1f3767392db33a
Author: Tyler Senne <tsenne2 huskers unl edu>
Date: Sat Apr 17 16:37:17 2021 -0500
common: Fix broken decorator
tests/common.py | 7 ++++---
tests/test_clipproperties.py | 2 +-
tests/test_timeline_elements.py | 2 +-
3 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/tests/common.py b/tests/common.py
index cc1db65ae..ee5cfb97d 100644
--- a/tests/common.py
+++ b/tests/common.py
@@ -27,6 +27,7 @@ import sys
import tempfile
import traceback
import unittest
+from typing import List
from unittest import mock
from gi.repository import Gdk
@@ -188,13 +189,13 @@ class CheckedOperationDuration:
signal.alarm(0)
-def setup_project_with_clips(assets_names=None): # pylint: disable=unused-argument
+def setup_project_with_clips(assets_names: List[str]):
"""Sets up a Pitivi instance with the specified assets on the timeline."""
+ # Ensure this method is not being used directly as a decorator.
+ assert isinstance(assets_names, list)
def decorator(func):
nonlocal assets_names
- if assets_names is None:
- assets_names = ["1sec_simpsons_trailer.mp4"]
def wrapper(self):
with cloned_sample(*assets_names):
diff --git a/tests/test_clipproperties.py b/tests/test_clipproperties.py
index e16855c1e..c4e51fb3b 100644
--- a/tests/test_clipproperties.py
+++ b/tests/test_clipproperties.py
@@ -585,7 +585,7 @@ class SpeedPropertiesTest(common.TestCase):
self.timeline_container.timeline.selection.select([clip1])
self.assert_applied_rate(1, 2.0, clip1_duration / 2)
- @common.setup_project_with_clips
+ @common.setup_project_with_clips(assets_names=["1sec_simpsons_trailer.mp4"])
@common.setup_clipproperties
def test_load_project_clip_speed(self):
sources_count = 2
diff --git a/tests/test_timeline_elements.py b/tests/test_timeline_elements.py
index 39b448825..1e87d0935 100644
--- a/tests/test_timeline_elements.py
+++ b/tests/test_timeline_elements.py
@@ -412,7 +412,7 @@ class TestVideoSource(common.TestCase):
self.assertEqual(width, 960)
self.assertEqual(height, 400)
- @common.setup_project_with_clips
+ @common.setup_project_with_clips(assets_names=["1sec_simpsons_trailer.mp4"])
@common.setup_clipproperties
def test_change_set_project_size(self):
"""Checks the size of the scaled clips after project settings changes."""
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]