Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#480)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.3.5 → v0.3.7](astral-sh/ruff-pre-commit@v0.3.5...v0.3.7)
- [github.com/psf/black: 24.3.0 → 24.4.0](psf/black@24.3.0...24.4.0)

* Switch to pytest style

* Ignore broken test

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Kiran Jonnalagadda <kiran@hasgeek.com>
  • Loading branch information
pre-commit-ci[bot] and jace authored Apr 15, 2024
1 parent 85fb1f5 commit 4325666
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repos:
hooks:
- id: check-pre-commit-ci-config
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.5
rev: v0.3.7
hooks:
- id: ruff
args: ['--fix', '--exit-non-zero-on-fix']
Expand Down Expand Up @@ -58,7 +58,7 @@ repos:
additional_dependencies:
- toml
- repo: https://github.com/psf/black
rev: 24.3.0
rev: 24.4.0
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-mypy
Expand Down
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -286,3 +286,7 @@ section-order = [

[tool.ruff.lint.isort.sections]
repo = ['baseframe']

[tool.ruff.lint.flake8-pytest-style]
fixture-parentheses = false
mark-parentheses = false
3 changes: 1 addition & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# Config for tools that don't yet support pyproject.toml

[flake8]
ignore = I100, I201, E501, E124, E128, E402, E704, W503, D100, D101, D102, D103, D104, D107, S101
ignore = I100, I201, E501, E124, E128, E402, E704, W503, D100, D101, D102, D103, D104, D107, S101, A005
max-line-length = 88
exclude = src/baseframe/static
enable-extensions = G
accept-encodings = utf-8
classmethod-decorators=classmethod, declared_attr
pytest-fixture-no-parentheses = false

[pycodestyle]
max-line-length = 88
Expand Down
2 changes: 0 additions & 2 deletions src/baseframe/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@
'errors',
'extensions',
'filters',
'filters',
'forms',
'forms',
'localize_timezone',
'localized_country_list',
Expand Down
6 changes: 3 additions & 3 deletions tests/baseframe_tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from baseframe import baseframe


@pytest.fixture()
@pytest.fixture
def app():
"""App fixture."""
fixture_app = Flask(__name__)
Expand All @@ -18,13 +18,13 @@ def app():
return fixture_app


@pytest.fixture()
@pytest.fixture
def ctx(app):
with app.app_context() as context:
yield context


@pytest.fixture()
@pytest.fixture
def client(app):
"""App client fixture."""
with app.test_client() as test_client:
Expand Down
4 changes: 2 additions & 2 deletions tests/baseframe_tests/forms/fields_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class DateTimeForm(forms.Form):
# --- Tests ----------------------------------------------------------------------------


@pytest.fixture()
@pytest.fixture
def enum_form(ctx):
"""Enum form fixture."""
return EnumForm(meta={'csrf': False})
Expand Down Expand Up @@ -88,7 +88,7 @@ def test_enum_render(enum_form) -> None:
)


@pytest.fixture()
@pytest.fixture
def json_form(ctx):
"""JSON form fixture."""
return JsonForm(meta={'csrf': False})
Expand Down
2 changes: 1 addition & 1 deletion tests/baseframe_tests/forms/form_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class FieldRenderForm(forms.Form):
string_field = forms.StringField("String")


@pytest.fixture()
@pytest.fixture
def user() -> SimpleUser:
return SimpleUser( # nosec
fullname="Test user", company="Test company", password="test"
Expand Down
6 changes: 3 additions & 3 deletions tests/baseframe_tests/forms/sqlalchemy_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class DocumentForm(forms.Form):
content = forms.TextAreaField("Content")


@pytest.fixture()
@pytest.fixture
def database(app):
"""Database structure."""
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite://'
Expand All @@ -52,7 +52,7 @@ def database(app):
db.drop_all()


@pytest.fixture()
@pytest.fixture
def db_session(database):
"""Database session fixture."""
savepoint = database.session.begin_nested()
Expand All @@ -61,7 +61,7 @@ def db_session(database):
database.session.rollback()


@pytest.fixture()
@pytest.fixture
def form(ctx):
return DocumentForm(model=Document, meta={'csrf': False})

Expand Down
2 changes: 1 addition & 1 deletion tests/baseframe_tests/forms/validators_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class PublicEmailDomainFormTest(forms.Form):
)


@pytest.fixture()
@pytest.fixture
def tforms(ctx):
urllib3.disable_warnings()
yield SimpleNamespace(
Expand Down
8 changes: 4 additions & 4 deletions tests/baseframe_tests/statsd_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@
from baseframe.statsd import Statsd


@pytest.fixture()
@pytest.fixture
def app():
"""Redefine app without Baseframe for statsd tests."""
return Flask(__name__)


@pytest.fixture()
@pytest.fixture
def statsd(app):
s = Statsd()
s.init_app(app)
return s


@pytest.fixture()
@pytest.fixture
def view(app):
@app.route('/')
def index():
Expand All @@ -39,7 +39,7 @@ def index():
return index


@pytest.fixture()
@pytest.fixture
def form(app):
Babel(app) # Needed for form validator message translations

Expand Down
2 changes: 1 addition & 1 deletion tests/baseframe_tests/utils_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# --- Fixtures -------------------------------------------------------------------------


@pytest.fixture()
@pytest.fixture
def testview(app):
"""Add a view to the app for testing."""

Expand Down

0 comments on commit 4325666

Please sign in to comment.