Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit089e7bb

Browse files
committed
Upgrade ruff.
1 parentab2cd26 commit089e7bb

File tree

5 files changed

+10
-11
lines changed

5 files changed

+10
-11
lines changed

‎.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ exclude: '^(\.tox|ci/templates|\.bumpversion\.cfg)(/|$)'
66
# Note the order is intentional to avoid multiple passes of the hooks
77
repos:
88
-repo:https://github.com/astral-sh/ruff-pre-commit
9-
rev:v0.6.5
9+
rev:v0.11.2
1010
hooks:
1111
-id:ruff
1212
args:[--fix, --exit-non-zero-on-fix, --show-fixes, --unsafe-fixes]
1313
-id:ruff-format
1414
-repo:https://github.com/pre-commit/pre-commit-hooks
15-
rev:v4.6.0
15+
rev:v5.0.0
1616
hooks:
1717
-id:trailing-whitespace
1818
-id:end-of-file-fixer

‎setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def finalize_options(self):
7272
defrun(self):
7373
withPath(__file__).parent.joinpath('src','pytest-cov.pth').open('w')asfh:
7474
withPath(__file__).parent.joinpath('src','pytest-cov.embed').open()assh:
75-
fh.write(f"import os, sys;exec({sh.read().replace('',' ')!r})")
75+
fh.write(f'import os, sys;exec({sh.read().replace(""," ")!r})')
7676

7777

7878
setup(

‎src/pytest_cov/engine.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def summary(self, stream):
180180

181181
# Output coverage section header.
182182
iflen(self.node_descs)==1:
183-
self.sep(stream,'_',f"coverage:{''.join(self.node_descs)}")
183+
self.sep(stream,'_',f'coverage:{"".join(self.node_descs)}')
184184
else:
185185
self.sep(stream,'_','coverage')
186186
fornode_descinsorted(self.node_descs):
@@ -366,7 +366,7 @@ def testnodedown(self, node, error):
366366
# If worker is not collocated then we must save the data file
367367
# that it returns to us.
368368
if'cov_worker_data'inoutput:
369-
data_suffix='%s.%s.%06d.%s'% (
369+
data_suffix='%s.%s.%06d.%s'% (# noqa: UP031
370370
socket.gethostname(),
371371
os.getpid(),
372372
random.randint(0,999999),# noqa: S311

‎src/pytest_cov/plugin.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ def validate_fail_under(num_str):
5656
raiseargparse.ArgumentTypeError('An integer or float value is required.')fromNone
5757
ifvalue>100:
5858
raiseargparse.ArgumentTypeError(
59-
'Your desire for over-achievement is admirable but misplaced. '
60-
'The maximum value is 100. Perhaps write more integration tests?'
59+
'Your desire for over-achievement is admirable but misplaced. The maximum value is 100. Perhaps write more integration tests?'
6160
)
6261
returnvalue
6362

@@ -387,7 +386,7 @@ def pytest_terminal_summary(self, terminalreporter):
387386
self.write_heading(terminalreporter)
388387
failed=self.cov_total<self.options.cov_fail_under
389388
markup= {'red':True,'bold':True}iffailedelse {'green':True}
390-
message='{fail}Required test coverage of {required}% {reached}.''Total coverage: {actual:.2f}%\n'.format(
389+
message='{fail}Required test coverage of {required}% {reached}. Total coverage: {actual:.2f}%\n'.format(
391390
required=self.options.cov_fail_under,
392391
actual=self.cov_total,
393392
fail='FAIL 'iffailedelse'',
@@ -434,7 +433,7 @@ def switch_context(self, item, when):
434433

435434

436435
@pytest.fixture
437-
defno_cover():# noqa: PT004
436+
defno_cover():
438437
"""A pytest fixture to disable coverage."""
439438

440439

‎tests/test_pytest_cov.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ def test_term_missing_output_dir(testdir):
414414

415415
result.stderr.fnmatch_lines(
416416
[
417-
'*argument --cov-report: output specifier not supported for:''"term-missing:%s"*'%DEST_DIR,
417+
'*argument --cov-report: output specifier not supported for: "term-missing:%s"*'%DEST_DIR,
418418
]
419419
)
420420
assertresult.ret!=0
@@ -1773,7 +1773,7 @@ def bad_init():
17731773
monkeypatch.setattr(sys,'stderr',buff)
17741774
monkeypatch.setitem(os.environ,'COV_CORE_SOURCE','foobar')
17751775
exec(payload)
1776-
expected='pytest-cov: Failed to setup subprocess coverage.'"Environ: {'COV_CORE_SOURCE': 'foobar'} Exception: SpecificError()\n"
1776+
expected="pytest-cov: Failed to setup subprocess coverage. Environ: {'COV_CORE_SOURCE': 'foobar'} Exception: SpecificError()\n"
17771777
assertbuff.getvalue()==expected
17781778

17791779

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp