Skip to content

Commit

Permalink
Fix pre-commit configuration and update files
Browse files Browse the repository at this point in the history
* Fix flake8 URL
* Update hooks to latest versions
  • Loading branch information
nicoddemus committed Oct 23, 2023
1 parent b731fec commit 3f43e5c
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 22 deletions.
14 changes: 7 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
rev: v4.5.0
hooks:
- id: check-byte-order-marker
- id: trailing-whitespace
Expand All @@ -9,19 +9,19 @@ repos:
args: [--remove]
- id: check-yaml
- repo: https://github.com/asottile/reorder_python_imports
rev: v2.4.0
rev: v3.12.0
hooks:
- id: reorder-python-imports
args: ['--application-directories=.:src', --py3-plus]
- repo: https://github.com/python/black
rev: 20.8b1
rev: 23.10.0
hooks:
- id: black
- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.4
- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
hooks:
- id: flake8
additional_dependencies: [flake8-bugbear]
additional_dependencies: [flake8-bugbear]
- repo: local
hooks:
- id: rst
Expand All @@ -31,6 +31,6 @@ repos:
language: python
additional_dependencies: [pygments, restructuredtext_lint]
- repo: https://github.com/myint/autoflake.git
rev: v1.4
rev: v2.2.1
hooks:
- id: autoflake
15 changes: 7 additions & 8 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
# serve to show the default.
import datetime
import os
import sys

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
Expand Down Expand Up @@ -42,8 +41,8 @@
master_doc = "index"

# General information about the project.
project = u"pytest-flask"
copyright = u"%d, Vital Kudzelka and contributors" % datetime.date.today().year
project = "pytest-flask"
copyright = "%d, Vital Kudzelka and contributors" % datetime.date.today().year

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down Expand Up @@ -203,8 +202,8 @@
(
"index",
"pytest-flask.tex",
u"pytest-flask Documentation",
u"Vital Kudzelka",
"pytest-flask Documentation",
"Vital Kudzelka",
"manual",
),
]
Expand Down Expand Up @@ -235,7 +234,7 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
("index", "pytest-flask", u"pytest-flask Documentation", [u"Vital Kudzelka"], 1)
("index", "pytest-flask", "pytest-flask Documentation", ["Vital Kudzelka"], 1)
]

# If true, show URL addresses after external links.
Expand All @@ -251,8 +250,8 @@
(
"index",
"pytest-flask",
u"pytest-flask Documentation",
u"Vital Kudzelka",
"pytest-flask Documentation",
"Vital Kudzelka",
"pytest-flask",
"One line description of project.",
"Miscellaneous",
Expand Down
1 change: 0 additions & 1 deletion src/pytest_flask/fixtures.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env python
import socket
import warnings

import pytest

Expand Down
4 changes: 2 additions & 2 deletions src/pytest_flask/live_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ def stop(self):
self._process.terminate()

def _stop_cleanly(self, timeout=5):
"""Attempts to stop the server cleanly by sending a SIGINT signal and waiting for
``timeout`` seconds.
"""Attempts to stop the server cleanly by sending a SIGINT
signal and waiting for ``timeout`` seconds.
:return: True if the server was cleanly stopped, False otherwise.
"""
Expand Down
4 changes: 2 additions & 2 deletions tests/test_internal.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ def deprecated_fun():

with pytest.warns(DeprecationWarning) as record:
deprecated_fun()
assert len(record) == 1
assert record[0].message.args[0] == "testing decorator"
assert len(record) == 1
assert record[0].message.args[0] == "testing decorator"
4 changes: 2 additions & 2 deletions tests/test_live_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ def test_stop_cleanly_join_exception(self, appdir, live_server, caplog):
def test_clean_stop_live_server(self, appdir, monkeypatch, clean_stop):
"""Ensure the fixture is trying to cleanly stop the server.
Because this is tricky to test, we are checking that the _stop_cleanly() internal
function was called and reported success.
Because this is tricky to test, we are checking that the
_stop_cleanly() internal function was called and reported success.
"""
from pytest_flask.fixtures import LiveServer

Expand Down

0 comments on commit 3f43e5c

Please sign in to comment.