Remove unnecessary pass statements

This commit is contained in:
Florian Bruhin 2018-11-28 11:26:40 +01:00
parent 5ed3fb723d
commit 2453134011
29 changed files with 1 additions and 127 deletions

View File

@ -60,8 +60,6 @@ class UnsupportedAttribute:
supported with QtWebengine. supported with QtWebengine.
""" """
pass
class UnsupportedOperationError(Exception): class UnsupportedOperationError(Exception):

View File

@ -49,8 +49,6 @@ class WebInspectorError(Exception):
"""Raised when the inspector could not be initialized.""" """Raised when the inspector could not be initialized."""
pass
class AbstractWebInspector(QWidget): class AbstractWebInspector(QWidget):

View File

@ -35,15 +35,11 @@ class ParseProxyError(Exception):
"""Error while parsing PAC result string.""" """Error while parsing PAC result string."""
pass
class EvalProxyError(Exception): class EvalProxyError(Exception):
"""Error while evaluating PAC script.""" """Error while evaluating PAC script."""
pass
def _js_slot(*args): def _js_slot(*args):
"""Wrap a methods as a JavaScript function. """Wrap a methods as a JavaScript function.

View File

@ -61,36 +61,26 @@ class Error(Exception):
"""Exception for generic errors on a qute:// page.""" """Exception for generic errors on a qute:// page."""
pass
class NotFoundError(Error): class NotFoundError(Error):
"""Raised when the given URL was not found.""" """Raised when the given URL was not found."""
pass
class SchemeOSError(Error): class SchemeOSError(Error):
"""Raised when there was an OSError inside a handler.""" """Raised when there was an OSError inside a handler."""
pass
class UrlInvalidError(Error): class UrlInvalidError(Error):
"""Raised when an invalid URL was opened.""" """Raised when an invalid URL was opened."""
pass
class RequestDeniedError(Error): class RequestDeniedError(Error):
"""Raised when the request is forbidden.""" """Raised when the request is forbidden."""
pass
class Redirect(Exception): class Redirect(Exception):

View File

@ -43,29 +43,21 @@ class Error(Exception):
"""Base class for all errors in this module.""" """Base class for all errors in this module."""
pass
class InvalidUrlError(Error): class InvalidUrlError(Error):
"""Exception emitted when a URL is invalid.""" """Exception emitted when a URL is invalid."""
pass
class DoesNotExistError(Error): class DoesNotExistError(Error):
"""Exception emitted when a given URL does not exist.""" """Exception emitted when a given URL does not exist."""
pass
class AlreadyExistsError(Error): class AlreadyExistsError(Error):
"""Exception emitted when a given URL does already exist.""" """Exception emitted when a given URL does already exist."""
pass
class UrlMarkManager(QObject): class UrlMarkManager(QObject):

View File

@ -34,15 +34,11 @@ class Error(Exception):
"""Base class for WebElement errors.""" """Base class for WebElement errors."""
pass
class OrphanedError(Error): class OrphanedError(Error):
"""Raised when a webelement's parent has vanished.""" """Raised when a webelement's parent has vanished."""
pass
def css_selector(group, url): def css_selector(group, url):
"""Get a CSS selector for the given group/URL.""" """Get a CSS selector for the given group/URL."""

View File

@ -516,7 +516,6 @@ class _NoCloseBytesIO(io.BytesIO):
def close(self): def close(self):
"""Do nothing.""" """Do nothing."""
pass
def actual_close(self): def actual_close(self):
"""Close the stream.""" """Close the stream."""

View File

@ -67,7 +67,6 @@ class FixedDataNetworkReply(QNetworkReply):
@pyqtSlot() @pyqtSlot()
def abort(self): def abort(self):
"""Abort the operation.""" """Abort the operation."""
pass
def bytesAvailable(self): def bytesAvailable(self):
"""Determine the bytes available for being read. """Determine the bytes available for being read.
@ -123,7 +122,6 @@ class ErrorNetworkReply(QNetworkReply):
def abort(self): def abort(self):
"""Do nothing since it's a fake reply.""" """Do nothing since it's a fake reply."""
pass
def bytesAvailable(self): def bytesAvailable(self):
"""We always have 0 bytes available.""" """We always have 0 bytes available."""
@ -151,7 +149,6 @@ class RedirectNetworkReply(QNetworkReply):
def abort(self): def abort(self):
"""Called when there's e.g. a redirection limit.""" """Called when there's e.g. a redirection limit."""
pass
def readData(self, _maxlen): def readData(self, _maxlen):
return bytes() return bytes()

View File

@ -31,8 +31,6 @@ class IsNullError(webelem.Error):
"""Gets raised by WebKitElement if an element is null.""" """Gets raised by WebKitElement if an element is null."""
pass
class WebKitElement(webelem.AbstractWebElement): class WebKitElement(webelem.AbstractWebElement):

View File

@ -41,7 +41,6 @@ class WebHistoryInterface(QWebHistoryInterface):
def addHistoryEntry(self, url_string): def addHistoryEntry(self, url_string):
"""Required for a QWebHistoryInterface impl, obsoleted by add_url.""" """Required for a QWebHistoryInterface impl, obsoleted by add_url."""
pass
@functools.lru_cache(maxsize=32768) @functools.lru_cache(maxsize=32768)
def historyContains(self, url_string): def historyContains(self, url_string):

View File

@ -32,22 +32,16 @@ class CommandError(Error):
"""Raised when a command encounters an error while running.""" """Raised when a command encounters an error while running."""
pass
class NoSuchCommandError(Error): class NoSuchCommandError(Error):
"""Raised when a command wasn't found.""" """Raised when a command wasn't found."""
pass
class ArgumentTypeError(Error): class ArgumentTypeError(Error):
"""Raised when an argument had an invalid type.""" """Raised when an argument had an invalid type."""
pass
class PrerequisitesError(Error): class PrerequisitesError(Error):
@ -56,5 +50,3 @@ class PrerequisitesError(Error):
This is raised for example when we're in the wrong mode while executing the This is raised for example when we're in the wrong mode while executing the
command, or we need javascript enabled but don't have done so. command, or we need javascript enabled but don't have done so.
""" """
pass

View File

@ -28,8 +28,6 @@ class Error(Exception):
"""Base exception for config-related errors.""" """Base exception for config-related errors."""
pass
class NoAutoconfigError(Error): class NoAutoconfigError(Error):

View File

@ -25,5 +25,3 @@ from qutebrowser.mainwindow.statusbar import textbase
class KeyString(textbase.TextBase): class KeyString(textbase.TextBase):
"""Keychain string displayed in the statusbar.""" """Keychain string displayed in the statusbar."""
pass

View File

@ -29,15 +29,11 @@ class HistoryEmptyError(Exception):
"""Raised when the history is empty.""" """Raised when the history is empty."""
pass
class HistoryEndReachedError(Exception): class HistoryEndReachedError(Exception):
"""Raised when the end of the history is reached.""" """Raised when the end of the history is reached."""
pass
class History(QObject): class History(QObject):

View File

@ -197,7 +197,6 @@ class _CrashDialog(QDialog):
def _init_checkboxes(self): def _init_checkboxes(self):
"""Initialize the checkboxes.""" """Initialize the checkboxes."""
pass
def _init_buttons(self): def _init_buttons(self):
"""Initialize the buttons.""" """Initialize the buttons."""
@ -569,7 +568,6 @@ class ReportDialog(_CrashDialog):
def _init_info_text(self): def _init_info_text(self):
"""We don't want an info text as the user wanted to report.""" """We don't want an info text as the user wanted to report."""
pass
def _get_error_type(self): def _get_error_type(self):
return 'report' return 'report'

View File

@ -72,8 +72,6 @@ class SqlEnvironmentError(SqlError):
disk or I/O errors), where qutebrowser isn't to blame. disk or I/O errors), where qutebrowser isn't to blame.
""" """
pass
class SqlBugError(SqlError): class SqlBugError(SqlError):
@ -82,8 +80,6 @@ class SqlBugError(SqlError):
This is raised for errors resulting from a qutebrowser bug. This is raised for errors resulting from a qutebrowser bug.
""" """
pass
def raise_sqlite_error(msg, error): def raise_sqlite_error(msg, error):
"""Raise either a SqlBugError or SqlEnvironmentError.""" """Raise either a SqlBugError or SqlEnvironmentError."""

View File

@ -370,7 +370,6 @@ def window_only(current_win_id):
@cmdutils.register() @cmdutils.register()
def nop(): def nop():
"""Do nothing.""" """Do nothing."""
pass
@cmdutils.register() @cmdutils.register()

View File

@ -42,8 +42,6 @@ class RegistryUnavailableError(Exception):
"""Exception raised when a certain registry does not exist yet.""" """Exception raised when a certain registry does not exist yet."""
pass
class NoWindow(Exception): class NoWindow(Exception):

View File

@ -630,7 +630,6 @@ def open_file(filename, cmdline=None):
def unused(_arg): def unused(_arg):
"""Function which does nothing to avoid pylint complaining.""" """Function which does nothing to avoid pylint complaining."""
pass
def expand_windows_drive(path): def expand_windows_drive(path):

View File

@ -33,8 +33,6 @@ class Error(Exception):
"""Exception for errors in this module.""" """Exception for errors in this module."""
pass
def parse(): def parse():
"""Parse command line arguments.""" """Parse command line arguments."""

View File

@ -34,8 +34,6 @@ class Error(Exception):
"""Exception raised when linking fails.""" """Exception raised when linking fails."""
pass
def run_py(executable, *code): def run_py(executable, *code):
"""Run the given python code with the given executable.""" """Run the given python code with the given executable."""

View File

@ -842,8 +842,6 @@ class YamlLoader(yaml.SafeLoader):
"""Custom YAML loader used in compare_session.""" """Custom YAML loader used in compare_session."""
pass
# Translate ... to ellipsis in YAML. # Translate ... to ellipsis in YAML.
YamlLoader.add_constructor('!ellipsis', lambda loader, node: ...) YamlLoader.add_constructor('!ellipsis', lambda loader, node: ...)

View File

@ -39,15 +39,11 @@ class InvalidLine(Exception):
"""Raised when the process prints a line which is not parsable.""" """Raised when the process prints a line which is not parsable."""
pass
class ProcessExited(Exception): class ProcessExited(Exception):
"""Raised when the child process did exit.""" """Raised when the child process did exit."""
pass
class WaitForTimeout(Exception): class WaitForTimeout(Exception):
@ -271,7 +267,6 @@ class Process(QObject):
def _after_start(self): def _after_start(self):
"""Do things which should be done immediately after starting.""" """Do things which should be done immediately after starting."""
pass
def before_test(self): def before_test(self):
"""Restart process before a test if it exited before.""" """Restart process before a test if it exited before."""
@ -443,7 +438,6 @@ class Process(QObject):
QuteProc._maybe_skip, and call _maybe_skip after every parsed message QuteProc._maybe_skip, and call _maybe_skip after every parsed message
in wait_for (where it's most likely that new messages arrive). in wait_for (where it's most likely that new messages arrive).
""" """
pass
def wait_for(self, timeout=None, *, override_waited_for=False, def wait_for(self, timeout=None, *, override_waited_for=False,
do_skip=False, divisor=1, after=None, **kwargs): do_skip=False, divisor=1, after=None, **kwargs):

View File

@ -306,7 +306,6 @@ class FakeSignal:
Currently does nothing, but could be improved to do some sanity Currently does nothing, but could be improved to do some sanity
checking on the slot. checking on the slot.
""" """
pass
def disconnect(self, slot=None): def disconnect(self, slot=None):
"""Disconnect the signal from a slot. """Disconnect the signal from a slot.
@ -314,7 +313,6 @@ class FakeSignal:
Currently does nothing, but could be improved to do some sanity Currently does nothing, but could be improved to do some sanity
checking on the slot and see if it actually got connected. checking on the slot and see if it actually got connected.
""" """
pass
def emit(self, *args): def emit(self, *args):
"""Emit the signal. """Emit the signal.
@ -322,7 +320,6 @@ class FakeSignal:
Currently does nothing, but could be improved to do type checking based Currently does nothing, but could be improved to do type checking based
on a signature given to __init__. on a signature given to __init__.
""" """
pass
@attr.s @attr.s
@ -457,8 +454,6 @@ class BookmarkManagerStub(UrlMarkManagerStub):
"""Stub for the bookmark-manager object.""" """Stub for the bookmark-manager object."""
pass
class QuickmarkManagerStub(UrlMarkManagerStub): class QuickmarkManagerStub(UrlMarkManagerStub):

View File

@ -48,7 +48,6 @@ def _get_cmd(*args, **kwargs):
@cmdutils.register(*args, **kwargs) @cmdutils.register(*args, **kwargs)
def fun(): def fun():
"""Blah.""" """Blah."""
pass
return cmdutils.cmd_dict['fun'] return cmdutils.cmd_dict['fun']
@ -83,7 +82,6 @@ class TestRegister:
@cmdutils.register() @cmdutils.register()
def fun(): def fun():
"""Blah.""" """Blah."""
pass
cmd = cmdutils.cmd_dict['fun'] cmd = cmdutils.cmd_dict['fun']
assert cmd.handler is fun assert cmd.handler is fun
@ -95,7 +93,6 @@ class TestRegister:
@cmdutils.register() @cmdutils.register()
def eggs_bacon(): def eggs_bacon():
"""Blah.""" """Blah."""
pass
assert cmdutils.cmd_dict['eggs-bacon'].name == 'eggs-bacon' assert cmdutils.cmd_dict['eggs-bacon'].name == 'eggs-bacon'
assert 'eggs_bacon' not in cmdutils.cmd_dict assert 'eggs_bacon' not in cmdutils.cmd_dict
@ -105,7 +102,6 @@ class TestRegister:
@cmdutils.register() @cmdutils.register()
def Test(): # noqa: N801,N806 pylint: disable=invalid-name def Test(): # noqa: N801,N806 pylint: disable=invalid-name
"""Blah.""" """Blah."""
pass
assert cmdutils.cmd_dict['test'].name == 'test' assert cmdutils.cmd_dict['test'].name == 'test'
assert 'Test' not in cmdutils.cmd_dict assert 'Test' not in cmdutils.cmd_dict
@ -115,7 +111,6 @@ class TestRegister:
@cmdutils.register(name='foobar') @cmdutils.register(name='foobar')
def fun(): def fun():
"""Blah.""" """Blah."""
pass
assert cmdutils.cmd_dict['foobar'].name == 'foobar' assert cmdutils.cmd_dict['foobar'].name == 'foobar'
assert 'fun' not in cmdutils.cmd_dict assert 'fun' not in cmdutils.cmd_dict
@ -126,20 +121,17 @@ class TestRegister:
@cmdutils.register(name='foobar') @cmdutils.register(name='foobar')
def fun(): def fun():
"""Blah.""" """Blah."""
pass
with pytest.raises(ValueError): with pytest.raises(ValueError):
@cmdutils.register(name='foobar') @cmdutils.register(name='foobar')
def fun2(): def fun2():
"""Blah.""" """Blah."""
pass
def test_instance(self): def test_instance(self):
"""Make sure the instance gets passed to Command.""" """Make sure the instance gets passed to Command."""
@cmdutils.register(instance='foobar') @cmdutils.register(instance='foobar')
def fun(self): def fun(self):
"""Blah.""" """Blah."""
pass
assert cmdutils.cmd_dict['fun']._instance == 'foobar' assert cmdutils.cmd_dict['fun']._instance == 'foobar'
def test_star_args(self): def test_star_args(self):
@ -147,7 +139,6 @@ class TestRegister:
@cmdutils.register() @cmdutils.register()
def fun(*args): def fun(*args):
"""Blah.""" """Blah."""
pass
with pytest.raises(argparser.ArgumentParserError): with pytest.raises(argparser.ArgumentParserError):
cmdutils.cmd_dict['fun'].parser.parse_args([]) cmdutils.cmd_dict['fun'].parser.parse_args([])
@ -195,14 +186,12 @@ class TestRegister:
@cmdutils.argument('arg1', flag='b') @cmdutils.argument('arg1', flag='b')
def fun(arg1=False, arg2=False): def fun(arg1=False, arg2=False):
"""Blah.""" """Blah."""
pass
def test_win_id(self): def test_win_id(self):
@cmdutils.register() @cmdutils.register()
@cmdutils.argument('win_id', win_id=True) @cmdutils.argument('win_id', win_id=True)
def fun(win_id): def fun(win_id):
"""Blah.""" """Blah."""
pass
assert cmdutils.cmd_dict['fun']._get_call_args(42) == ([42], {}) assert cmdutils.cmd_dict['fun']._get_call_args(42) == ([42], {})
def test_count(self): def test_count(self):
@ -210,7 +199,6 @@ class TestRegister:
@cmdutils.argument('count', count=True) @cmdutils.argument('count', count=True)
def fun(count=0): def fun(count=0):
"""Blah.""" """Blah."""
pass
assert cmdutils.cmd_dict['fun']._get_call_args(42) == ([0], {}) assert cmdutils.cmd_dict['fun']._get_call_args(42) == ([0], {})
def test_count_without_default(self): def test_count_without_default(self):
@ -220,7 +208,6 @@ class TestRegister:
@cmdutils.argument('count', count=True) @cmdutils.argument('count', count=True)
def fun(count): def fun(count):
"""Blah.""" """Blah."""
pass
@pytest.mark.parametrize('hide', [True, False]) @pytest.mark.parametrize('hide', [True, False])
def test_pos_args(self, hide): def test_pos_args(self, hide):
@ -228,7 +215,6 @@ class TestRegister:
@cmdutils.argument('arg', hide=hide) @cmdutils.argument('arg', hide=hide)
def fun(arg): def fun(arg):
"""Blah.""" """Blah."""
pass
pos_args = cmdutils.cmd_dict['fun'].pos_args pos_args = cmdutils.cmd_dict['fun'].pos_args
if hide: if hide:
@ -283,7 +269,6 @@ class TestRegister:
@cmdutils.argument('arg', choices=['foo', 'bar']) @cmdutils.argument('arg', choices=['foo', 'bar'])
def fun(arg): def fun(arg):
"""Blah.""" """Blah."""
pass
cmd = cmdutils.cmd_dict['fun'] cmd = cmdutils.cmd_dict['fun']
cmd.namespace = cmd.parser.parse_args(['fish']) cmd.namespace = cmd.parser.parse_args(['fish'])
@ -297,7 +282,6 @@ class TestRegister:
@cmdutils.argument('arg', choices=['foo', 'bar']) @cmdutils.argument('arg', choices=['foo', 'bar'])
def fun(*, arg='foo'): def fun(*, arg='foo'):
"""Blah.""" """Blah."""
pass
cmd = cmdutils.cmd_dict['fun'] cmd = cmdutils.cmd_dict['fun']
cmd.namespace = cmd.parser.parse_args(['--arg=fish']) cmd.namespace = cmd.parser.parse_args(['--arg=fish'])
@ -312,7 +296,6 @@ class TestRegister:
@cmdutils.argument('opt') @cmdutils.argument('opt')
def fun(foo, bar, opt=False): def fun(foo, bar, opt=False):
"""Blah.""" """Blah."""
pass
cmd = cmdutils.cmd_dict['fun'] cmd = cmdutils.cmd_dict['fun']
assert cmd.get_pos_arg_info(0) == command.ArgInfo(choices=('a', 'b')) assert cmd.get_pos_arg_info(0) == command.ArgInfo(choices=('a', 'b'))
@ -324,7 +307,6 @@ class TestRegister:
# https://github.com/qutebrowser/qutebrowser/issues/1872 # https://github.com/qutebrowser/qutebrowser/issues/1872
def fun(*, target): def fun(*, target):
"""Blah.""" """Blah."""
pass
with pytest.raises(TypeError, match="fun: handler has keyword only " with pytest.raises(TypeError, match="fun: handler has keyword only "
"argument 'target' without default!"): "argument 'target' without default!"):
@ -334,7 +316,6 @@ class TestRegister:
# https://github.com/qutebrowser/qutebrowser/issues/1872 # https://github.com/qutebrowser/qutebrowser/issues/1872
def fun(*, target: int): def fun(*, target: int):
"""Blah.""" """Blah."""
pass
with pytest.raises(TypeError, match="fun: handler has keyword only " with pytest.raises(TypeError, match="fun: handler has keyword only "
"argument 'target' without default!"): "argument 'target' without default!"):
@ -350,14 +331,12 @@ class TestArgument:
@cmdutils.argument('foo') @cmdutils.argument('foo')
def fun(bar): def fun(bar):
"""Blah.""" """Blah."""
pass
def test_storage(self): def test_storage(self):
@cmdutils.argument('foo', flag='x') @cmdutils.argument('foo', flag='x')
@cmdutils.argument('bar', flag='y') @cmdutils.argument('bar', flag='y')
def fun(foo, bar): def fun(foo, bar):
"""Blah.""" """Blah."""
pass
expected = { expected = {
'foo': command.ArgInfo(flag='x'), 'foo': command.ArgInfo(flag='x'),
'bar': command.ArgInfo(flag='y') 'bar': command.ArgInfo(flag='y')
@ -372,7 +351,6 @@ class TestArgument:
@cmdutils.register() @cmdutils.register()
def fun(bar): def fun(bar):
"""Blah.""" """Blah."""
pass
def test_count_and_win_id_same_arg(self): def test_count_and_win_id_same_arg(self):
with pytest.raises(TypeError, with pytest.raises(TypeError,
@ -380,7 +358,6 @@ class TestArgument:
@cmdutils.argument('arg', count=True, win_id=True) @cmdutils.argument('arg', count=True, win_id=True)
def fun(arg=0): def fun(arg=0):
"""Blah.""" """Blah."""
pass
def test_no_docstring(self, caplog): def test_no_docstring(self, caplog):
with caplog.at_level(logging.WARNING): with caplog.at_level(logging.WARNING):
@ -388,6 +365,7 @@ class TestArgument:
def fun(): def fun():
# no docstring # no docstring
pass pass
assert len(caplog.records) == 1 assert len(caplog.records) == 1
assert caplog.messages[0].endswith('test_cmdutils.py has no docstring') assert caplog.messages[0].endswith('test_cmdutils.py has no docstring')
@ -398,7 +376,6 @@ class TestArgument:
@cmdutils.register() @cmdutils.register()
def fun(): def fun():
# no docstring # no docstring
pass
class TestRun: class TestRun:
@ -441,7 +418,6 @@ class TestRun:
backend=usertypes.Backend.QtWebEngine) backend=usertypes.Backend.QtWebEngine)
def fun(self): def fun(self):
"""Blah.""" """Blah."""
pass
monkeypatch.setattr(command.objects, 'backend', monkeypatch.setattr(command.objects, 'backend',
usertypes.Backend.QtWebKit) usertypes.Backend.QtWebKit)

View File

@ -105,35 +105,29 @@ def cmdutils_patch(monkeypatch, stubs, miscmodels_patch):
@cmdutils.argument('value', completion=miscmodels_patch.value) @cmdutils.argument('value', completion=miscmodels_patch.value)
def set_command(section_=None, option=None, value=None): def set_command(section_=None, option=None, value=None):
"""docstring.""" """docstring."""
pass
@cmdutils.argument('topic', completion=miscmodels_patch.helptopic) @cmdutils.argument('topic', completion=miscmodels_patch.helptopic)
def show_help(tab=False, bg=False, window=False, topic=None): def show_help(tab=False, bg=False, window=False, topic=None):
"""docstring.""" """docstring."""
pass
@cmdutils.argument('url', completion=miscmodels_patch.url) @cmdutils.argument('url', completion=miscmodels_patch.url)
@cmdutils.argument('count', count=True) @cmdutils.argument('count', count=True)
def openurl(url=None, related=False, bg=False, tab=False, window=False, def openurl(url=None, related=False, bg=False, tab=False, window=False,
count=None): count=None):
"""docstring.""" """docstring."""
pass
@cmdutils.argument('win_id', win_id=True) @cmdutils.argument('win_id', win_id=True)
@cmdutils.argument('command', completion=miscmodels_patch.command) @cmdutils.argument('command', completion=miscmodels_patch.command)
def bind(key, win_id, command=None, *, mode='normal'): def bind(key, win_id, command=None, *, mode='normal'):
"""docstring.""" """docstring."""
pass
def tab_give(): def tab_give():
"""docstring.""" """docstring."""
pass
@cmdutils.argument('option', completion=miscmodels_patch.option) @cmdutils.argument('option', completion=miscmodels_patch.option)
@cmdutils.argument('values', completion=miscmodels_patch.value) @cmdutils.argument('values', completion=miscmodels_patch.value)
def config_cycle(option, *values): def config_cycle(option, *values):
"""For testing varargs.""" """For testing varargs."""
pass
cmd_utils = stubs.FakeCmdUtils({ cmd_utils = stubs.FakeCmdUtils({
'set': command.Command(name='set', handler=set_command), 'set': command.Command(name='set', handler=set_command),

View File

@ -336,8 +336,6 @@ class SavefileTestException(Exception):
"""Exception raised in TestSavefileOpen for testing.""" """Exception raised in TestSavefileOpen for testing."""
pass
@pytest.mark.usefixtures('qapp') @pytest.mark.usefixtures('qapp')
class TestSavefileOpen: class TestSavefileOpen:
@ -541,7 +539,6 @@ if test_file is not None:
def testReadinto_text(self): def testReadinto_text(self):
"""Skip this test as BufferedIOBase seems to fail it.""" """Skip this test as BufferedIOBase seems to fail it."""
pass
class PyOtherFileTests(PyIODeviceTestMixin, test_file.OtherFileTests, class PyOtherFileTests(PyIODeviceTestMixin, test_file.OtherFileTests,
unittest.TestCase): unittest.TestCase):
@ -550,11 +547,9 @@ if test_file is not None:
def testSetBufferSize(self): def testSetBufferSize(self):
"""Skip this test as setting buffer size is unsupported.""" """Skip this test as setting buffer size is unsupported."""
pass
def testTruncateOnWindows(self): def testTruncateOnWindows(self):
"""Skip this test truncating is unsupported.""" """Skip this test truncating is unsupported."""
pass
class FailingQIODevice(QIODevice): class FailingQIODevice(QIODevice):

View File

@ -409,8 +409,6 @@ class GotException(Exception):
"""Exception used for TestDisabledExcepthook.""" """Exception used for TestDisabledExcepthook."""
pass
def excepthook(_exc, _val, _tb): def excepthook(_exc, _val, _tb):
pass pass
@ -512,8 +510,6 @@ class Obj:
"""Test object for test_get_repr().""" """Test object for test_get_repr()."""
pass
@pytest.mark.parametrize('constructor, attrs, expected', [ @pytest.mark.parametrize('constructor, attrs, expected', [
(False, {}, '<test_utils.Obj>'), (False, {}, '<test_utils.Obj>'),
@ -534,12 +530,10 @@ class QualnameObj():
def func(self): def func(self):
"""Test method for test_qualname.""" """Test method for test_qualname."""
pass
def qualname_func(_blah): def qualname_func(_blah):
"""Test function for test_qualname.""" """Test function for test_qualname."""
pass
QUALNAME_OBJ = QualnameObj() QUALNAME_OBJ = QualnameObj()
@ -578,8 +572,6 @@ class TestIsEnum:
"""Test class for is_enum.""" """Test class for is_enum."""
pass
assert not utils.is_enum(Test) assert not utils.is_enum(Test)
def test_object(self): def test_object(self):
@ -597,7 +589,6 @@ class TestRaises:
def do_nothing(self): def do_nothing(self):
"""Helper function which does nothing.""" """Helper function which does nothing."""
pass
@pytest.mark.parametrize('exception, value, expected', [ @pytest.mark.parametrize('exception, value, expected', [
(ValueError, 'a', True), (ValueError, 'a', True),

View File

@ -29,8 +29,6 @@ class Parent(QObject):
"""Class for test_parent().""" """Class for test_parent()."""
pass
def test_parent(): def test_parent():
"""Make sure the parent is set correctly.""" """Make sure the parent is set correctly."""