[pitivi] Enabled pydocstyle to check docstrings



commit afb81e7948165a5a3d838c546106309f5086e379
Author: Alexandru Băluț <alexandru balut gmail com>
Date:   Sat Oct 26 21:13:11 2019 +0200

    Enabled pydocstyle to check docstrings

 .pre-commit-config.yaml          |  7 +++++++
 pitivi/clipproperties.py         |  3 ++-
 pitivi/dialogs/prefs.py          |  2 ++
 pitivi/editorperspective.py      |  1 -
 pitivi/effects.py                |  2 +-
 pitivi/greeterperspective.py     |  1 +
 pitivi/pluginmanager.py          |  1 +
 pitivi/preset.py                 |  2 +-
 pitivi/project.py                |  1 -
 pitivi/render.py                 |  3 ++-
 pitivi/timeline/markers.py       |  2 +-
 pitivi/timeline/previewers.py    |  1 +
 pitivi/undo/markers.py           |  4 ++--
 pitivi/utils/check_pipeline.py   |  6 +++---
 pitivi/utils/loggable.py         | 33 ++++++++++++++++++---------------
 pitivi/utils/misc.py             |  3 +--
 pitivi/utils/system.py           |  2 ++
 pitivi/utils/timeline.py         |  2 +-
 pitivi/utils/widgets.py          |  3 ++-
 plugins/console/consolebuffer.py |  4 +---
 tests/__init__.py                |  5 +----
 tests/common.py                  |  4 +---
 tests/ptv_testsuite.py           |  3 ++-
 tests/test_editorperspective.py  |  2 +-
 tests/test_pluginmanager.py      |  2 +-
 tests/test_project.py            |  1 -
 tests/test_render.py             |  2 +-
 tests/test_timeline_markers.py   |  6 +++---
 tests/test_undo.py               | 36 ++++++++++++------------------------
 tests/test_undo_timeline.py      |  2 +-
 tests/test_widgets.py            |  3 +--
 31 files changed, 73 insertions(+), 76 deletions(-)
---
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 25fab6e9..f1aaa856 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -15,3 +15,10 @@ repos:
     rev: v1.7.0
     hooks:
     -   id: reorder-python-imports
+-   repo: https://github.com/pycqa/pydocstyle
+    rev: 4.0.1
+    hooks:
+    -   id: pydocstyle
+        args:
+        # http://www.pydocstyle.org/en/latest/error_codes.html
+        -   --ignore=D1,D203,D213,D401,D406,D407,D413
diff --git a/pitivi/clipproperties.py b/pitivi/clipproperties.py
index a47223b4..6bfeb1be 100644
--- a/pitivi/clipproperties.py
+++ b/pitivi/clipproperties.py
@@ -151,7 +151,8 @@ class EffectProperties(Gtk.Expander, Loggable):
         # We need to specify Gtk.TreeDragSource because otherwise we are hitting
         # bug https://bugzilla.gnome.org/show_bug.cgi?id=730740.
         class EffectsListStore(Gtk.ListStore, Gtk.TreeDragSource):
-            """Just a work around!"""
+            """Just a work around."""
+
             # pylint: disable=non-parent-init-called
             def __init__(self, *args):
                 Gtk.ListStore.__init__(self, *args)
diff --git a/pitivi/dialogs/prefs.py b/pitivi/dialogs/prefs.py
index 1e6672a3..caa9dc3f 100644
--- a/pitivi/dialogs/prefs.py
+++ b/pitivi/dialogs/prefs.py
@@ -55,6 +55,7 @@ GlobalSettings.addConfigOption('prefsDialogHeight',
 
 class PreferencesDialog(Loggable):
     """Preferences for how the app works."""
+
     _instance = None
     prefs = {}
     section_names = {
@@ -599,6 +600,7 @@ class ModelItem(GObject.Object):
 
 class CustomShortcutDialog(Gtk.Dialog):
     """Dialog for customising accelerator invoked by activating a row in preferences."""
+
     FORBIDDEN_KEYVALS = [Gdk.KEY_Escape]
 
     def __init__(self, app, pref_dialog, customised_item):
diff --git a/pitivi/editorperspective.py b/pitivi/editorperspective.py
index ff910fce..be1c2a99 100644
--- a/pitivi/editorperspective.py
+++ b/pitivi/editorperspective.py
@@ -575,7 +575,6 @@ class EditorPerspective(Perspective, Loggable):
         Args:
             project (Project): The project which has been closed.
         """
-
         # We must disconnect from the project pipeline before it is released:
         if project.pipeline is not None:
             project.pipeline.deactivatePositionListener()
diff --git a/pitivi/effects.py b/pitivi/effects.py
index 48c784fa..931b06fc 100644
--- a/pitivi/effects.py
+++ b/pitivi/effects.py
@@ -19,7 +19,7 @@
 # Boston, MA 02110-1301, USA.
 """Effects categorization and management.
 
- There are different types of effects available:
+There are different types of effects available:
   _ Simple Audio/Video Effects
      GStreamer elements that only apply to audio OR video
      Only take the elements who have a straightforward meaning/action
diff --git a/pitivi/greeterperspective.py b/pitivi/greeterperspective.py
index cff5ee20..d18d9835 100644
--- a/pitivi/greeterperspective.py
+++ b/pitivi/greeterperspective.py
@@ -46,6 +46,7 @@ class ProjectInfoRow(Gtk.ListBoxRow):
     Attributes:
         recent_project_item (Gtk.RecentInfo): Recent project's meta-data.
     """
+
     def __init__(self, recent_project_item):
         Gtk.ListBoxRow.__init__(self)
         self.uri = recent_project_item.get_uri()
diff --git a/pitivi/pluginmanager.py b/pitivi/pluginmanager.py
index 5ce558aa..481d8775 100644
--- a/pitivi/pluginmanager.py
+++ b/pitivi/pluginmanager.py
@@ -45,6 +45,7 @@ class API(GObject.GObject):
 
 class PluginType(IntEnum):
     """Types of plugins we support, depending on their directory location."""
+
     # pylint: disable=comparison-with-callable,inconsistent-return-statements,no-else-return
 
     SYSTEM = 1
diff --git a/pitivi/preset.py b/pitivi/preset.py
index 3d950213..9e058e47 100644
--- a/pitivi/preset.py
+++ b/pitivi/preset.py
@@ -546,7 +546,7 @@ class EncodingTargetManager(PresetManager):
         return name
 
     def saveCurrentPreset(self, new_name, validate_name=True):
-        """PresetManager override, saves currently selected profile on disk.
+        """Saves currently selected profile on disk.
 
         Override from PresetManager
 
diff --git a/pitivi/project.py b/pitivi/project.py
index 9d6a19b3..5e51626f 100644
--- a/pitivi/project.py
+++ b/pitivi/project.py
@@ -2065,7 +2065,6 @@ class ProjectSettingsDialog:
 
     def _setupUiConstraints(self):
         """Creates the dynamic widgets and connects other widgets."""
-
         # Add custom framerate fraction widget.
         frame_rate_box = self.builder.get_object("frame_rate_box")
         self.frame_rate_fraction_widget = FractionWidget()
diff --git a/pitivi/render.py b/pitivi/render.py
index e74004a0..702f1b5e 100644
--- a/pitivi/render.py
+++ b/pitivi/render.py
@@ -391,6 +391,7 @@ class RenderDialog(Loggable):
         preferred_aencoder (str): The last audio encoder selected by the user.
         preferred_vencoder (str): The last video encoder selected by the user.
     """
+
     INHIBIT_REASON = _("Currently rendering")
 
     _factory_formats = {}
@@ -877,7 +878,7 @@ class RenderDialog(Loggable):
             factory (Gst.ElementFactory): The factory for editing.
             media_type (str): String describing the media type ('audio' or 'video')
         """
-        # Reconsitute the property name from the media type (vcodecsettings or acodecsettings)
+        # Reconstitute the property name from the media type (vcodecsettings or acodecsettings)
         properties = getattr(self.project, media_type[0] + 'codecsettings')
 
         self.dialog = GstElementSettingsDialog(factory, properties=properties,
diff --git a/pitivi/timeline/markers.py b/pitivi/timeline/markers.py
index 2a1b282e..c7cca804 100644
--- a/pitivi/timeline/markers.py
+++ b/pitivi/timeline/markers.py
@@ -29,7 +29,7 @@ MARKER_WIDTH = 10
 
 # pylint: disable=too-many-instance-attributes
 class Marker(Gtk.EventBox, Loggable):
-    """Widget representing a marker"""
+    """Widget representing a marker."""
 
     def __init__(self, ges_marker):
         Gtk.EventBox.__init__(self)
diff --git a/pitivi/timeline/previewers.py b/pitivi/timeline/previewers.py
index a7c75db0..38120097 100644
--- a/pitivi/timeline/previewers.py
+++ b/pitivi/timeline/previewers.py
@@ -80,6 +80,7 @@ GlobalSettings.addConfigOption("previewers_max_cpu",
 
 class PreviewerBin(Gst.Bin, Loggable):
     """Baseclass for elements gathering data to create previews."""
+
     def __init__(self, bin_desc):
         Gst.Bin.__init__(self)
         Loggable.__init__(self)
diff --git a/pitivi/undo/markers.py b/pitivi/undo/markers.py
index d4c720a8..e9d727e2 100644
--- a/pitivi/undo/markers.py
+++ b/pitivi/undo/markers.py
@@ -16,7 +16,7 @@
 # License along with this program; if not, write to the
 # Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
 # Boston, MA 02110-1301, USA.
-"""Undo/redo markers"""
+"""Undo/redo logic for markers."""
 from gi.repository import Gst
 
 from pitivi.undo.undo import MetaContainerObserver
@@ -71,7 +71,7 @@ class MarkerListObserver(Loggable):
 
 # pylint: disable=abstract-method, too-many-ancestors
 class MarkerAction(UndoableAutomaticObjectAction):
-    """Base class for add and remove marker actions"""
+    """Base class for marker actions."""
 
     def __init__(self, ges_marker_list, ges_marker):
         UndoableAutomaticObjectAction.__init__(self, ges_marker)
diff --git a/pitivi/utils/check_pipeline.py b/pitivi/utils/check_pipeline.py
index 0a425e89..6c765204 100644
--- a/pitivi/utils/check_pipeline.py
+++ b/pitivi/utils/check_pipeline.py
@@ -30,7 +30,7 @@ from gi.repository import GLib
 
 
 def pipeline_message_cb(_, msg, pipeline):
-    """GStreamer bus message handler."""
+    """Handles a GStreamer bus message."""
     if msg.type == Gst.MessageType.ASYNC_DONE:
         print("pipeline successfully PAUSED")
         pipeline.set_state(Gst.State.NULL)
@@ -44,13 +44,13 @@ def pipeline_message_cb(_, msg, pipeline):
 
 
 def timeout_cb(*args, **kwargs):
-    """Exit on timeout."""
+    """Exits on timeout."""
     print("check_pipeline: Pipeline timed out", file=sys.stderr)
     sys.exit(1)
 
 
 def main():
-    """Main function of the small app."""
+    """Runs this small tool."""
     os.environ["G_DEBUG"] = "fatal-criticals"
     Gst.init(None)
     pipeline = Gst.parse_launch(sys.argv[1])
diff --git a/pitivi/utils/loggable.py b/pitivi/utils/loggable.py
index e9d11992..6939fe99 100644
--- a/pitivi/utils/loggable.py
+++ b/pitivi/utils/loggable.py
@@ -106,6 +106,7 @@ class TerminalController:
             output; if this stream is not a tty, then the terminal is
             assumed to be a dumb terminal (i.e., have no capabilities).
     """
+
     # Cursor movement:
     BOL = ''             # : Move the cursor to the beginning of the line
     UP = ''              # : Move the cursor up one line
@@ -373,7 +374,6 @@ def setLogSettings(state):
     Args:
         state: The settings to set.
     """
-
     global _DEBUG
     global _log_handlers
     global _log_handlers_limited
@@ -412,9 +412,7 @@ def _canShortcutLogging(category, level):
 
 
 def scrubFilename(filename):
-    '''
-    Scrub the filename to a relative path for all packages in our scrub list.
-    '''
+    """Scrubs the filename to a relative path."""
     global _PACKAGE_SCRUB_LIST
     for package in _PACKAGE_SCRUB_LIST:
         i = filename.rfind(package)
@@ -495,10 +493,15 @@ def getFormatArgs(startFormat, startArgs, endFormat, endArgs, args, kwargs):
     return format, debugArgs
 
 
-def doLog(level, object, category, format, args, where=-1, filePath=None, line=None):
+def doLog(level, object, category, message, args, where=-1, filePath=None, line=None):
     """Logs something.
 
     Args:
+        level (int): Debug level.
+        object (str): Object converted to str.
+        category (str): Category such as the name of the object's class.
+        message (str): The message to log.
+        args (list): The args to apply to the message, if any.
         where (int or function): What to log file and line number for;
             -1 for one frame above log.py; -2 and down for higher up;
             a function for a (future) code object.
@@ -516,9 +519,7 @@ def doLog(level, object, category, format, args, where=-1, filePath=None, line=N
     ret = {}
 
     if args:
-        message = format % args
-    else:
-        message = format
+        message = message % args
     funcname = None
 
     if level > getCategoryLevel(category):
@@ -607,10 +608,12 @@ def printHandler(level, object, category, file, line, message):
     in Pitivi's case, that is True when the GST_DEBUG env var is defined.
 
     Args:
-        level (str):
-        object (str): Can be None.
-        category (str):
-        message (str):
+        level (str): The debug level.
+        object (Optional[str]): The object the message is about, or None.
+        category (str): Category such as the name of the object's class.
+        file (str): The source file where the message originates.
+        line (int): The line number in the file where the message originates.
+        message (str): The message to be logged.
     """
     global _outfile
 
@@ -677,6 +680,8 @@ def init(envVarName, enableColorOutput=True, enableCrackOutput=True):
     Args:
         envVarName (str): The name of the environment variable with additional
             settings.
+        enableColorOutput (Optional[bool]): Whether to colorize the output.
+        enableCrackOutput (Optional[bool]): Whether to print detailed info.
     """
     global _initialized
     global _outfile
@@ -767,7 +772,6 @@ def addLogHandler(func):
     Raises:
         TypeError: When func is not a callable.
     """
-
     if not isinstance(func, collections.Callable):
         raise TypeError("func must be callable")
 
@@ -994,8 +998,7 @@ class BaseLoggable:
                   self.logCategory, *self.logFunction(*args))
 
     def doLog(self, level, where, format, *args, **kwargs):
-        """Logs a message at the specified level, with the possibility of going
-        higher up in the stack.
+        """Logs a message at the specified level.
 
         Args:
             level (int): The log level.
diff --git a/pitivi/utils/misc.py b/pitivi/utils/misc.py
index 1e3dc826..291b5755 100644
--- a/pitivi/utils/misc.py
+++ b/pitivi/utils/misc.py
@@ -440,8 +440,7 @@ def video_info_get_rotation(video_info):
 
 
 def video_info_get_natural_width(video_info):
-    """Applies the pixel aspect ratio and rotation information
-       to the width of the video info.
+    """Gets the width by applying the pixel aspect ratio and rotation.
 
     Args:
         video_info (GstPbutils.DiscovererVideoInfo): The video info.
diff --git a/pitivi/utils/system.py b/pitivi/utils/system.py
index dd6018e3..f21b7227 100644
--- a/pitivi/utils/system.py
+++ b/pitivi/utils/system.py
@@ -14,6 +14,7 @@
 #
 # You should have received a copy of the GNU Lesser General Public
 # License along with this program; if not, see <http://www.gnu.org/licenses/>.
+"""Logic for checking the system features availability."""
 import datetime
 import multiprocessing
 import os
@@ -37,6 +38,7 @@ class System(GObject.Object, Loggable):
 
         self._x11 = False
         try:
+            # pylint: disable=unused-import
             from gi.repository import GdkX11
             self._x11 = True
         except ImportError:
diff --git a/pitivi/utils/timeline.py b/pitivi/utils/timeline.py
index 069a369a..58bfffd7 100644
--- a/pitivi/utils/timeline.py
+++ b/pitivi/utils/timeline.py
@@ -446,7 +446,7 @@ class Zoomable:
 
     @classmethod
     def nsToPixel(cls, duration):
-        """Returns the pixel equivalent of the specified duration"""
+        """Returns the pixel equivalent of the specified duration."""
         # Here, a long time ago (206f3a05), a pissed programmer said:
         # DIE YOU CUNTMUNCH CLOCK_TIME_NONE UBER STUPIDITY OF CRACK BINDINGS !!
         if duration == Gst.CLOCK_TIME_NONE:
diff --git a/pitivi/utils/widgets.py b/pitivi/utils/widgets.py
index 6cb61453..f91d43cc 100644
--- a/pitivi/utils/widgets.py
+++ b/pitivi/utils/widgets.py
@@ -1192,7 +1192,8 @@ class GstElementSettingsDialog(Loggable):
         """Gets the settings of the `element`.
 
         Returns:
-            dict: A property name to value map."""
+            dict: A property name to value map.
+        """
         return self.elementsettings.getSettings()
 
     def get_caps(self):
diff --git a/plugins/console/consolebuffer.py b/plugins/console/consolebuffer.py
index 226c8307..d8786088 100644
--- a/plugins/console/consolebuffer.py
+++ b/plugins/console/consolebuffer.py
@@ -171,9 +171,7 @@ class ConsoleBuffer(Gtk.TextBuffer):
             self.__refresh_prompt(new_command)
 
     def get_autocompletion_matches(self, input_text):
-        """
-        Given an input text, return possible matches for autocompletion.
-        """
+        """Returns possible matches for autocompletion."""
         # pylint: disable=bare-except, eval-used, too-many-branches, too-many-locals
         # Try to get the possible full object to scan.
         # For example, if input_text is "func(circle.ra", we obtain "circle.ra".
diff --git a/tests/__init__.py b/tests/__init__.py
index 61e741aa..2cfe59c2 100644
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -1,7 +1,5 @@
 #!/usr/bin/env python3
-"""
-Pitivi unit tests
-"""
+"""Pitivi unit tests."""
 import os
 import sys
 from tempfile import mkdtemp
@@ -18,7 +16,6 @@ def get_pitivi_dir():
 
 def _prepend_env_paths(**args):
     """Prepends one or more paths to an environment variable."""
-
     for name, value in args.items():
         if not isinstance(value, list):
             value = [value]
diff --git a/tests/common.py b/tests/common.py
index d90a05ba..67dc7361 100644
--- a/tests/common.py
+++ b/tests/common.py
@@ -16,9 +16,7 @@
 # License along with this program; if not, write to the
 # Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
 # Boston, MA 02110-1301, USA.
-"""
-A collection of objects to use for testing
-"""
+"""Useful objects for testing."""
 import contextlib
 import gc
 import locale
diff --git a/tests/ptv_testsuite.py b/tests/ptv_testsuite.py
index 76a6019e..94737498 100644
--- a/tests/ptv_testsuite.py
+++ b/tests/ptv_testsuite.py
@@ -34,7 +34,8 @@ from launcher.baseclasses import Test
 
 
 class PitiviTest(Test):
-    """A launcher.Test subclass for our unit tests."""
+    """A Test corresponding to a module in our unit tests suite."""
+
     def build_arguments(self):
         """Builds subprocess arguments."""
         self.add_arguments('-m', 'unittest', '.'.join(self.classname.split('.')[1:]))
diff --git a/tests/test_editorperspective.py b/tests/test_editorperspective.py
index c630c1b2..658fb9ee 100644
--- a/tests/test_editorperspective.py
+++ b/tests/test_editorperspective.py
@@ -16,7 +16,7 @@
 # License along with this program; if not, write to the
 # Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
 # Boston, MA 02110-1301, USA.
-"""Tests for pitivi/editorperspective.py"""
+"""Tests for the pitivi.editorperspective module."""
 from unittest import mock
 
 from gi.repository import GES
diff --git a/tests/test_pluginmanager.py b/tests/test_pluginmanager.py
index a20d53ed..a7a52d30 100644
--- a/tests/test_pluginmanager.py
+++ b/tests/test_pluginmanager.py
@@ -33,9 +33,9 @@ class TestPluginManager(common.TestCase):
 
     def test_load_plugins_from_settings(self):
         """Checks if the plugin manager loads plugins from GlobalSettings."""
-
         class App(GObject.Object):
             """A representation of the Pitivi Application for test purposes."""
+
             __gsignals__ = {
                 "window-added": (GObject.SignalFlags.RUN_LAST, None, (object, ))
             }
diff --git a/tests/test_project.py b/tests/test_project.py
index bbd74892..904c9034 100644
--- a/tests/test_project.py
+++ b/tests/test_project.py
@@ -480,7 +480,6 @@ class TestProjectLoading(common.TestCase):
 
     def test_loading_project_with_moved_assets_and_deleted_proxy(self):
         """Loads a project with moved asset and deleted proxy file."""
-
         mainloop = common.create_main_loop()
 
         created_proxies = []
diff --git a/tests/test_render.py b/tests/test_render.py
index a568ad4e..ef66f794 100644
--- a/tests/test_render.py
+++ b/tests/test_render.py
@@ -113,7 +113,7 @@ class TestRender(BaseTestMediaLibrary):
         return project
 
     def create_rendering_dialog(self, project):
-        """Creates a RenderingDialog ready for testing"""
+        """Creates a RenderingDialog ready for testing."""
         from pitivi.render import RenderDialog
 
         class MockedBuilder(Gtk.Builder):
diff --git a/tests/test_timeline_markers.py b/tests/test_timeline_markers.py
index f1245139..c40240f9 100644
--- a/tests/test_timeline_markers.py
+++ b/tests/test_timeline_markers.py
@@ -28,10 +28,10 @@ from tests.test_undo_timeline import BaseTestUndoTimeline
 
 
 class TestMarkers(BaseTestUndoTimeline):
-    """Class for markers tests"""
+    """Tests for markers."""
 
     def test_marker_added_ui(self):
-        "Checks the add marker ui"
+        """Checks the add marker UI."""
         self.setup_timeline_container()
         markers = self.timeline.get_marker_list("markers")
         marker_box = self.timeline_container.markers
@@ -54,7 +54,7 @@ class TestMarkers(BaseTestUndoTimeline):
         self.assert_markers(markers, [(position, None)])
 
     def test_marker_removed_ui(self):
-        "Checks the remove marker ui"
+        """Checks the remove marker UI."""
         self.setup_timeline_container()
         markers = self.timeline.get_marker_list("markers")
         marker_box = self.timeline_container.markers
diff --git a/tests/test_undo.py b/tests/test_undo.py
index 34de3f0a..8ca1ea03 100644
--- a/tests/test_undo.py
+++ b/tests/test_undo.py
@@ -16,6 +16,7 @@
 # License along with this program; if not, write to the
 # Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
 # Boston, MA 02110-1301, USA.
+"""Tests for the pitivi.undo.undo module."""
 from unittest import mock
 
 from gi.repository import GES
@@ -31,11 +32,10 @@ from tests import common
 
 
 class TestUndoableActionStack(common.TestCase):
+    """Tests for the UndoableActionStack class."""
 
     def testUndoDo(self):
-        """
-        Test an undo() do() sequence.
-        """
+        """Checks an undo() and do() sequence."""
         state = {"actions": 2}
 
         class Action(UndoableAction):
@@ -59,9 +59,7 @@ class TestUndoableActionStack(common.TestCase):
         self.assertEqual(state["actions"], 2)
 
     def testUndoError(self):
-        """
-        Undo a stack containing a failing action.
-        """
+        """Checks undo a stack containing a failing action."""
         stack = UndoableActionStack("meh")
         action1 = mock.Mock(spec=UndoableAction)
         action1.expand.return_value = False
@@ -80,6 +78,7 @@ class TestUndoableActionStack(common.TestCase):
 
 
 class TestUndoableActionLog(common.TestCase):
+    """Tests for the UndoableActionLog class."""
 
     def setUp(self):
         self.log = UndoableActionLog()
@@ -139,9 +138,7 @@ class TestUndoableActionLog(common.TestCase):
         self.assertFalse(self.log.dirty())
 
     def testCommit(self):
-        """
-        Commit a stack.
-        """
+        """Checks committing a stack."""
         self.assertEqual(len(self.log.undo_stacks), 0)
         self.assertEqual(len(self.log.redo_stacks), 0)
         self.log.begin("meh")
@@ -167,9 +164,7 @@ class TestUndoableActionLog(common.TestCase):
         self.assertRaises(UndoWrongStateError, self.log.commit, "notmeh")
 
     def testNestedCommit(self):
-        """
-        Do two nested commits.
-        """
+        """Checks two nested commits."""
         self.assertEqual(len(self.log.undo_stacks), 0)
         self.assertEqual(len(self.log.redo_stacks), 0)
         self.log.begin("meh")
@@ -219,9 +214,7 @@ class TestUndoableActionLog(common.TestCase):
         action2.do.assert_not_called()
 
     def testRollback(self):
-        """
-        Test a rollback.
-        """
+        """Checks a rollback."""
         self.assertEqual(len(self.log.undo_stacks), 0)
         self.assertEqual(len(self.log.redo_stacks), 0)
         self.log.begin("meh")
@@ -239,9 +232,7 @@ class TestUndoableActionLog(common.TestCase):
         self.assertEqual(len(self.log.redo_stacks), 0)
 
     def testNestedRollback(self):
-        """
-        Test two nested rollbacks.
-        """
+        """Checks two nested rollbacks."""
         self.assertEqual(len(self.log.undo_stacks), 0)
         self.assertEqual(len(self.log.redo_stacks), 0)
         self.log.begin("meh")
@@ -275,9 +266,7 @@ class TestUndoableActionLog(common.TestCase):
         self.assertEqual(len(self.log.redo_stacks), 0)
 
     def testUndoRedo(self):
-        """
-        Try an undo() redo() sequence.
-        """
+        """Tries an undo() redo() sequence."""
         # begin
         self.log.begin("meh")
         self.assertEqual(len(self.signals), 1)
@@ -341,9 +330,7 @@ class TestUndoableActionLog(common.TestCase):
         self.assertEqual(action2.undo.call_count, 1)
 
     def testOrder(self):
-        """
-        Test that actions are undone and redone in the correct order.
-        """
+        """Checks actions are undone and redone in the correct order."""
         order = mock.Mock()
         order.action1 = mock.Mock(spec=UndoableAction)
         order.action1.expand.return_value = False
@@ -409,6 +396,7 @@ class TestUndoableActionLog(common.TestCase):
 
 
 class TestGObjectObserver(common.TestCase):
+    """Tests for the GObjectObserver class."""
 
     def test_property_change(self):
         action_log = UndoableActionLog()
diff --git a/tests/test_undo_timeline.py b/tests/test_undo_timeline.py
index db109434..33dc6a6e 100644
--- a/tests/test_undo_timeline.py
+++ b/tests/test_undo_timeline.py
@@ -83,7 +83,7 @@ class BaseTestUndoTimeline(common.TestCase):
         self.assertEqual(len(effects), count)
 
     def get_transition_element(self, ges_layer):
-        """"Gets the first found GES.VideoTransition clip."""
+        """Gets the first found GES.VideoTransition clip."""
         for clip in ges_layer.get_clips():
             if isinstance(clip, GES.TransitionClip):
                 for element in clip.get_children(False):
diff --git a/tests/test_widgets.py b/tests/test_widgets.py
index 54a37e71..37be3ea0 100644
--- a/tests/test_widgets.py
+++ b/tests/test_widgets.py
@@ -82,8 +82,7 @@ class TestFractionWidget(common.TestCase):
 class TestGstElementSettingsDialog(common.TestCase):
 
     def test_reusing_properties(self):
-        """Check that passing values to be used on element to be configured works."""
-
+        """Checks passing values to be used on element to be configured works."""
         dialog = GstElementSettingsDialog(Gst.ElementFactory.find("identity"), {"datarate": 12})
         v, = [v for (k, v) in dialog.elementsettings.properties.items() if k.name == "datarate"]
         self.assertEqual(v.getWidgetValue(), 12)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]