Skip to content

Commit

Permalink
[SchemaRegistry] migrate to test proxy (Azure#23438)
Browse files Browse the repository at this point in the history
fixes Azure#22517

- need to ignore pylint `import-error` due to same issue as here: pylint-dev/pylint#2862
  • Loading branch information
swathipil authored and rakshith91 committed Apr 10, 2022
1 parent 9f1dc11 commit b67be23
Show file tree
Hide file tree
Showing 97 changed files with 6,284 additions and 3,809 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@
# IN THE SOFTWARE.
#
# --------------------------------------------------------------------------
from ._version import VERSION
from ._version import VERSION # pylint: disable=import-error

__version__ = VERSION

from ._schema_registry_avro_encoder import AvroEncoder
from ._message_protocol import MessageType, MessageContent
from ._schema_registry_avro_encoder import AvroEncoder # pylint: disable=import-error
from ._message_protocol import MessageType, MessageContent # pylint: disable=import-error


__all__ = [
"AvroEncoder",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import avro
from avro.io import DatumWriter, DatumReader, BinaryDecoder, BinaryEncoder

from ._abstract_avro_encoder import AbstractAvroObjectEncoder
from ._abstract_avro_encoder import AbstractAvroObjectEncoder # pylint: disable=import-error

ObjectType = TypeVar("ObjectType")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@
from io import BytesIO
from typing import Any, Dict, Mapping, Optional, Union, Callable

from .exceptions import (
from .exceptions import ( # pylint: disable=import-error
SchemaParseError,
SchemaEncodeError,
SchemaDecodeError,
)
from ._apache_avro_encoder import ApacheAvroObjectEncoder as AvroObjectEncoder
from ._message_protocol import MessageContent, MessageType
from ._constants import (
from ._apache_avro_encoder import ApacheAvroObjectEncoder as AvroObjectEncoder # pylint: disable=import-error
from ._message_protocol import MessageContent, MessageType # pylint: disable=import-error
from ._constants import ( # pylint: disable=import-error
SCHEMA_ID_START_INDEX,
SCHEMA_ID_LENGTH,
CONTENT_START_INDEX,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# IN THE SOFTWARE.
#
# --------------------------------------------------------------------------
from ._schema_registry_avro_encoder_async import AvroEncoder
from ._schema_registry_avro_encoder_async import AvroEncoder # pylint: disable=import-error

__all__ = [
"AvroEncoder"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@
import logging
from io import BytesIO
from typing import Any, Callable, Dict, Mapping, Union, Optional
from ._async_lru import alru_cache
from .._constants import (
from ._async_lru import alru_cache # pylint: disable=import-error
from .._constants import ( # pylint: disable=import-error
SCHEMA_ID_START_INDEX,
SCHEMA_ID_LENGTH,
CONTENT_START_INDEX,
AVRO_MIME_TYPE,
RECORD_FORMAT_IDENTIFIER_LENGTH,
)
from .._message_protocol import MessageType, MessageContent
from .._apache_avro_encoder import ApacheAvroObjectEncoder as AvroObjectEncoder
from ..exceptions import (
from .._message_protocol import MessageType, MessageContent # pylint: disable=import-error
from .._apache_avro_encoder import ApacheAvroObjectEncoder as AvroObjectEncoder # pylint: disable=import-error
from ..exceptions import ( # pylint: disable=import-error
SchemaParseError,
SchemaEncodeError,
SchemaDecodeError,
Expand Down
13 changes: 13 additions & 0 deletions sdk/schemaregistry/azure-schemaregistry-avroencoder/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import pytest
from devtools_testutils import add_general_regex_sanitizer, test_proxy, add_oauth_response_sanitizer

# autouse=True will trigger this fixture on each pytest run, even if it's not explicitly used by a test method
@pytest.fixture(scope="session", autouse=True)
def add_sanitizers(test_proxy):
add_general_regex_sanitizer(regex="(?<=\\/\\/)[a-z-]+(?=\\.servicebus\\.windows\\.net)", value="fake_resource")
add_oauth_response_sanitizer()

# autouse=True will trigger this fixture on each pytest run, even if it's not explicitly used by a test method
@pytest.fixture(scope="session", autouse=True)
def start_proxy(test_proxy):
return
5 changes: 4 additions & 1 deletion sdk/schemaregistry/azure-schemaregistry-avroencoder/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@
],
python_requires=">=3.6",
zip_safe=False,
packages=find_packages(exclude=exclude_packages),
packages=[
'azure.schemaregistry.encoder.avroencoder',
'azure.schemaregistry.encoder.avroencoder.aio',
],
install_requires=install_packages
)
Loading

0 comments on commit b67be23

Please sign in to comment.