Skip to content

Commit

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

updates:
- [github.com/psf/black: 24.4.2 → 24.8.0](psf/black@24.4.2...24.8.0)
- [github.com/astral-sh/ruff-pre-commit: v0.5.0 → v0.6.3](astral-sh/ruff-pre-commit@v0.5.0...v0.6.3)
- [github.com/pre-commit/mirrors-mypy: v1.10.1 → v1.11.2](pre-commit/mirrors-mypy@v1.10.1...v1.11.2)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] authored Sep 3, 2024
1 parent f0a96d7 commit 1847251
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 16 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,22 @@ repos:
- id: text-unicode-replacement-char

- repo: https://github.com/psf/black
rev: 24.4.2
rev: 24.8.0
hooks:
- id: black
additional_dependencies: [toml]
- id: black-jupyter
additional_dependencies: [toml]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.5.0'
rev: 'v0.6.3'
hooks:
- id: ruff
args:
- --fix

- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.10.1'
rev: 'v1.11.2'
hooks:
- id: mypy
args:
Expand Down
13 changes: 7 additions & 6 deletions tests/core/descriptors/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,33 @@

# THIRD PARTY
import pytest

from bound_class.core.descriptors.base import BoundDescriptorBase


class BoundDescriptorBase_Test(metaclass=ABCMeta):
@pytest.fixture()
@pytest.fixture
@abstractmethod
def descr_cls(self) -> type:
return BoundDescriptorBase

@pytest.fixture()
@pytest.fixture
def encl_attr(self) -> str:
return "attr"

@pytest.fixture()
@pytest.fixture
def encl_cls(self, descr_cls, encl_attr) -> type:
return type("Enclosing", (object,), {encl_attr: descr_cls()})

@pytest.fixture()
@pytest.fixture
def descr_on_cls(self, encl_cls, encl_attr) -> object:
return vars(encl_cls)[encl_attr]

@pytest.fixture()
@pytest.fixture
def enclosing(self, encl_cls) -> object:
return encl_cls()

@pytest.fixture()
@pytest.fixture
def descr_on_inst(self, enclosing, encl_attr) -> object:
return getattr(enclosing, encl_attr)

Expand Down
3 changes: 2 additions & 1 deletion tests/core/descriptors/test_bound.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# THIRD PARTY
import pytest

from bound_class.core.descriptors import BoundDescriptor

from .test_base import BoundDescriptorBase_Test


class Test_BoundDescriptor(BoundDescriptorBase_Test):
@pytest.fixture()
@pytest.fixture
def descr_cls(self) -> type:
return BoundDescriptor

Expand Down
3 changes: 2 additions & 1 deletion tests/core/descriptors/test_instance.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# THIRD PARTY
import pytest

from bound_class.core.descriptors import InstanceDescriptor

from .test_base import BoundDescriptorBase_Test


class Test_InstanceDescriptor(BoundDescriptorBase_Test):
@pytest.fixture()
@pytest.fixture
def descr_cls(self) -> type:
return InstanceDescriptor

Expand Down
1 change: 1 addition & 0 deletions tests/core/descriptors/test_register.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

# THIRD PARTY
import pytest

from bound_class.core import register_descriptor
from bound_class.core.descriptors import BoundDescriptor
from bound_class.core.descriptors.register import DescriptorRegistrationWarning
Expand Down
11 changes: 6 additions & 5 deletions tests/core/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,33 @@

# THIRD PARTY
import pytest

from bound_class.core.base import BoundClass, BoundClassRef

#####################################################################


@pytest.fixture()
@pytest.fixture
def bound_cls() -> type:
return BoundClass


@pytest.fixture()
@pytest.fixture
def boundto_cls() -> type:
return type("Enclosing", (object,), {})


@pytest.fixture()
@pytest.fixture
def boundto(boundto_cls) -> object:
return boundto_cls()


@pytest.fixture()
@pytest.fixture
def unbound(bound_cls) -> object:
return bound_cls()


@pytest.fixture()
@pytest.fixture
def bound(bound_cls, boundto) -> object:
bound = bound_cls() # TODO: necessary?
bound._set__self__(boundto)
Expand Down

0 comments on commit 1847251

Please sign in to comment.