From b7883d442632760c88cde246d2dafd602c4a4e9d Mon Sep 17 00:00:00 2001 From: Subhash Bhushan Date: Thu, 7 Oct 2021 10:15:33 -0700 Subject: [PATCH] Tox check fixes --- src/protean/adapters/repository/elasticsearch.py | 2 +- src/protean/core/entity.py | 6 +----- tests/adapters/model/elasticsearch_model/conftest.py | 2 +- .../repository/sqlalchemy_repo/postgresql/conftest.py | 2 +- tests/value_object/test_to_dict.py | 4 ++-- 5 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/protean/adapters/repository/elasticsearch.py b/src/protean/adapters/repository/elasticsearch.py index fc923ed0..fea683a6 100644 --- a/src/protean/adapters/repository/elasticsearch.py +++ b/src/protean/adapters/repository/elasticsearch.py @@ -8,7 +8,7 @@ from elasticsearch import Elasticsearch from elasticsearch.exceptions import NotFoundError -from elasticsearch_dsl import Document, Index, Search, query, Keyword, Mapping +from elasticsearch_dsl import Document, Index, Keyword, Mapping, Search, query from protean.exceptions import ObjectNotFoundError from protean.fields import Reference diff --git a/src/protean/core/entity.py b/src/protean/core/entity.py index c03e6e2a..7c07ceb3 100644 --- a/src/protean/core/entity.py +++ b/src/protean/core/entity.py @@ -6,11 +6,7 @@ from functools import partial from protean.container import BaseContainer, OptionsMixin -from protean.exceptions import ( - IncorrectUsageError, - NotSupportedError, - ValidationError, -) +from protean.exceptions import IncorrectUsageError, NotSupportedError, ValidationError from protean.fields import Auto, Field, HasMany, Reference, ValueObject from protean.fields.association import Association, _ReferenceField from protean.reflection import _FIELDS, _ID_FIELD_NAME, attributes, fields, id_field diff --git a/tests/adapters/model/elasticsearch_model/conftest.py b/tests/adapters/model/elasticsearch_model/conftest.py index fecf002b..0d280e6c 100644 --- a/tests/adapters/model/elasticsearch_model/conftest.py +++ b/tests/adapters/model/elasticsearch_model/conftest.py @@ -37,8 +37,8 @@ def setup_db(): ComplexUser, Person, Provider, - User, ProviderCustomModel, + User, ) domain.register(Person) diff --git a/tests/adapters/repository/sqlalchemy_repo/postgresql/conftest.py b/tests/adapters/repository/sqlalchemy_repo/postgresql/conftest.py index 816aefa9..b290c021 100644 --- a/tests/adapters/repository/sqlalchemy_repo/postgresql/conftest.py +++ b/tests/adapters/repository/sqlalchemy_repo/postgresql/conftest.py @@ -31,7 +31,7 @@ def setup_db(): with domain.domain_context(): # Create all associated tables from .elements import Alien, ComplexUser, Person, User - from .test_associations import Comment, Post, Audit + from .test_associations import Audit, Comment, Post from .test_persistence import Event domain.register(Alien) diff --git a/tests/value_object/test_to_dict.py b/tests/value_object/test_to_dict.py index f4df79cf..9eee6778 100644 --- a/tests/value_object/test_to_dict.py +++ b/tests/value_object/test_to_dict.py @@ -1,9 +1,9 @@ from datetime import datetime -from protean.core.value_object import BaseValueObject +from protean import BaseAggregate +from protean.core.value_object import BaseValueObject from protean.fields.basic import DateTime, String from protean.fields.embedded import ValueObject -from protean import BaseAggregate class SimpleVO(BaseValueObject):