Skip to content

Commit f1528aa

Browse files
committed
MAINT: run ruff, fix obvious glitches
1 parent db24cc5 commit f1528aa

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

scpdt/tests/module_cases.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
__all__ = ['func', 'func2', 'func3', 'func4', 'func5', 'func6', 'func8', 'func7', 'manip_printoptions', 'array_abbreviation']
1+
__all__ = [
2+
'func', 'func2', 'func3', 'func4', 'func5', 'func6', 'func8',
3+
'func7', 'manip_printoptions', 'array_abbreviation'
4+
]
25

36
def func():
47
"""

scpdt/tests/test_finder.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ def test_explicit_object_list_with_module():
156156

157157
def test_find_doctests_api():
158158
# Test that the module itself is included with strategy='api'
159-
objs = [finder_cases, finder_cases.Klass]
160159
tests = find_doctests(finder_cases, strategy='api')
161160

162161
base = 'scpdt.tests.finder_cases'

scpdt/tests/test_parser.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
import doctest
2-
import pytest
3-
41
from ..impl import DTConfig, DTParser, DebugDTRunner
52

63

scpdt/tests/test_skipmarkers.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55

66

77
class TestSyntaxErrors:
8-
"""Syntax errors trigger a doctest failure *unless* marked with +SKIP or as pseudocode.
8+
"""Syntax errors trigger a doctest failure *unless* marked.
9+
10+
Either mark it with +SKIP or as pseudocode.
911
"""
1012
def test_invalid_python(self):
1113
# This string raises

scpdt/tests/test_testmod.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
import pytest
77

88
try:
9-
import scipy
9+
import scipy # noqa
1010
HAVE_SCIPY = True
11-
except:
11+
except Exception:
1212
HAVE_SCIPY = False
1313

1414
from . import (module_cases as module,
@@ -17,7 +17,7 @@
1717
failure_cases,
1818
failure_cases_2,
1919
local_file_cases)
20-
from ..frontend import testmod as _testmod, find_doctests, run_docstring_examples
20+
from ..frontend import testmod as _testmod, run_docstring_examples
2121
from ..util import warnings_errors
2222
from ..impl import DTConfig
2323

@@ -59,7 +59,6 @@ def test_run_docstring_examples():
5959

6060
def test_global_state():
6161
# Make sure doctesting does not alter the global state, as much as reasonable
62-
objs = [module.manip_printoptions]
6362
opts = np.get_printoptions()
6463
_testmod(module)
6564
new_opts = np.get_printoptions()
@@ -68,7 +67,7 @@ def test_global_state():
6867

6968
def test_module_debugrunner():
7069
with pytest.raises((doctest.UnexpectedException, doctest.DocTestFailure)):
71-
res = _testmod(failure_cases, raise_on_error=True)
70+
_testmod(failure_cases, raise_on_error=True)
7271

7372

7473
def test_verbosity_1():

0 commit comments

Comments
 (0)