Skip to content

Commit

Permalink
Fix utils test since docstring was used in test itself
Browse files Browse the repository at this point in the history
Ignore the D401 error instead.
  • Loading branch information
timj committed Jun 23, 2023
1 parent c8e7f06 commit 96feb15
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/test_cliUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def testHelp(self):
@repo_argument(help="repo help text")
@directory_argument(help="directory help text")
def cli():
"""Return the cli help message."""
"""The cli help message.""" # noqa: D401
pass

self.runTest(cli)
Expand All @@ -63,7 +63,7 @@ def testHelpWrapped(self):
@repo_argument(help="repo help text")
@directory_argument(help="directory help text")
def cli():
"""Return the cli help message."""
"""The cli help message.""" # noqa: D401
pass

self.runTest(cli)
Expand Down Expand Up @@ -199,9 +199,9 @@ def test_help(self):
arguments are declared.
Verify that MWArgument adds " ..." after the option metavar when
`nargs` != 1. The default behavior of click is to add elipsis when
nargs does not equal 1, but it does not put a space before the elipsis
and we prefer a space between the metavar and the elipsis.
`nargs` != 1. The default behavior of click is to add ellipsis when
nargs does not equal 1, but it does not put a space before the ellipsis
and we prefer a space between the metavar and the ellipsis.
"""
# nargs can be -1 for any number of args, or >= 1 for a specified
# number of arguments.
Expand Down
30 changes: 30 additions & 0 deletions tests/test_flake8.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This file is part of utils.
#
# Developed for the LSST Data Management System.
# This product includes software developed by the LSST Project
# (https://www.lsst.org).
# See the COPYRIGHT file at the top-level directory of this distribution
# for details of code ownership.
#
# Use of this source code is governed by a 3-clause BSD-style
# license that can be found in the LICENSE file.

import os
import sys
import unittest

import lsst.utils.tests

SCANDIR = os.path.realpath(os.path.join(os.path.dirname(__file__), os.path.pardir))


class Flake8TestCase(lsst.utils.tests.ExecutablesTestCase):
def test_flake8(self):
"""Run flake8 on the source code starting in the parent directory."""
self.assertExecutable(
sys.executable, args=["-m", "flake8", "-j", "auto", f"{SCANDIR}"], msg="Code failed flake8 check."
)


if __name__ == "__main__":
unittest.main()

0 comments on commit 96feb15

Please sign in to comment.