Skip to content

Commit e6a89e3

Browse files
committed
MAINT: run ruff w/ default config, fix reported violations
1 parent b814568 commit e6a89e3

File tree

5 files changed

+9
-10
lines changed

5 files changed

+9
-10
lines changed

scpdt/plugin.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,17 @@
22
A pytest plugin that provides enhanced doctesting for Pydata libraries
33
"""
44
import bdb
5-
import os
6-
import shutil
75
import warnings
86
import doctest
97

108

119
import pytest
12-
from _pytest import doctest as pydoctest, mark, outcomes
10+
import _pytest
11+
from _pytest import doctest as pydoctest, outcomes
1312
from _pytest.doctest import DoctestModule, DoctestTextfile
1413
from _pytest.pathlib import import_path
1514

16-
from scpdt.impl import DTChecker, DTParser, DebugDTRunner
15+
from scpdt.impl import DTParser, DebugDTRunner
1716
from scpdt.conftest import dt_config
1817
from scpdt.util import np_errstate, matplotlib_make_nongui, temp_cwd
1918
from scpdt.frontend import find_doctests
@@ -85,7 +84,7 @@ def _maybe_add_markers(item, config):
8584

8685
extra_skip = dt_config.pytest_extra_skip
8786
skip_it = item.name in extra_skip
88-
if item.name in extra_skip:
87+
if skip_it:
8988
reason = extra_skip[item.name] or ''
9089
item.add_marker(
9190
pytest.mark.skip(reason=reason)
@@ -163,7 +162,7 @@ def _is_deprecated(module):
163162

164163
res = False
165164
try:
166-
with warnings.catch_warnings() as w:
165+
with warnings.catch_warnings():
167166
warnings.simplefilter('error', DeprecationWarning)
168167
getattr(module, names[0])
169168
res = False

scpdt/tests/test_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from ..impl import DTConfig, DTParser, DebugDTRunner
1+
from ..impl import DTConfig, DTParser
22

33

44
def test_parser_default_config():

scpdt/tests/test_pytest_configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
except Exception:
1313
HAVE_SCIPY = False
1414

15-
from pathlib import PosixPath, Path
15+
from pathlib import Path
1616

1717
from . import module_cases, failure_cases, failure_cases_2, stopwords_cases, local_file_cases
1818

scpdt/tests/test_runner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def test_vanilla_checker(self):
9999
runner = DebugDTRunner(config=config)
100100
tests = DTFinder().find(module_cases.func)
101101

102-
with pytest.raises(doctest.DocTestFailure) as exc:
102+
with pytest.raises(doctest.DocTestFailure):
103103
for t in tests:
104104
runner.run(t)
105105

scpdt/tests/test_testmod.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import numpy as np
77

88
try:
9-
import matplotlib.pyplot as plt
9+
import matplotlib.pyplot as plt # noqa
1010
HAVE_MATPLOTLIB = True
1111
except Exception:
1212
HAVE_MATPLOTLIB = False

0 commit comments

Comments
 (0)