Skip to content

Commit 6f364b4

Browse files
authored
Merge pull request #126 from mattsb42-aws/dev-125
minor cleanup and blacklisting pytest 3.3.0
2 parents 46e9f34 + 81b0ff2 commit 6f364b4

File tree

11 files changed

+24
-12
lines changed

11 files changed

+24
-12
lines changed

src/aws_encryption_sdk_cli/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
from aws_encryption_sdk_cli.internal.metadata import MetadataWriter # noqa pylint: disable=unused-import
3232

3333

34-
try: # Python 3.5.0 and 3.5.1 have incompatible typing modules
34+
try: # Python 3.5.0 and 3.5.1 have incompatible typing modules
3535
from typing import List, Optional, Union # noqa pylint: disable=unused-import
3636
from aws_encryption_sdk_cli.internal.mypy_types import STREAM_KWARGS # noqa pylint: disable=unused-import
3737
except ImportError:

src/aws_encryption_sdk_cli/internal/arg_parsing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
from aws_encryption_sdk_cli.internal.logging_utils import LOGGER_NAME
2727
from aws_encryption_sdk_cli.internal.metadata import MetadataWriter
2828

29-
try: # Python 3.5.0 and 3.5.1 have incompatible typing modules
29+
try: # Python 3.5.0 and 3.5.1 have incompatible typing modules
3030
from typing import Any, Dict, List, Optional, Sequence, Tuple, Union # noqa pylint: disable=unused-import
3131
from aws_encryption_sdk_cli.internal.mypy_types import ( # noqa pylint: disable=unused-import
3232
ARGPARSE_TEXT, CACHING_CONFIG, COLLAPSED_CONFIG,

src/aws_encryption_sdk_cli/internal/encoding.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717
import io
1818
import logging
1919
import string
20-
from typing import IO, Iterable, List, Optional # noqa pylint: disable=unused-import
20+
from types import TracebackType # noqa pylint: disable=unused-import
2121

2222
import six
2323

2424
from aws_encryption_sdk_cli.internal.logging_utils import LOGGER_NAME
2525

26-
try: # Python 3.5.0 and 3.5.1 have incompatible typing modules
27-
from types import TracebackType # noqa pylint: disable=unused-import
26+
try: # Python 3.5.0 and 3.5.1 have incompatible typing modules
27+
from typing import IO, Iterable, List, Optional # noqa pylint: disable=unused-import
2828
except ImportError:
2929
# We only actually need these imports when running the mypy checks
3030
pass

src/aws_encryption_sdk_cli/internal/identifiers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"""Static identifier values for the AWS Encryption SDK CLI."""
1414
from enum import Enum
1515

16-
try: # Python 3.5.0 and 3.5.1 have incompatible typing modules
16+
try: # Python 3.5.0 and 3.5.1 have incompatible typing modules
1717
from typing import Dict, Set # noqa pylint: disable=unused-import
1818
except ImportError:
1919
# We only actually need these imports when running the mypy checks

src/aws_encryption_sdk_cli/internal/io_handling.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
from aws_encryption_sdk_cli.internal.metadata import json_ready_header, json_ready_header_auth
2929
from aws_encryption_sdk_cli.internal.metadata import MetadataWriter
3030

31-
try: # Python 3.5.0 and 3.5.1 have incompatible typing modules
31+
try: # Python 3.5.0 and 3.5.1 have incompatible typing modules
3232
from typing import cast, Dict, IO, List, Type, Union # noqa pylint: disable=unused-import
3333
from aws_encryption_sdk_cli.internal.mypy_types import SOURCE, STREAM_KWARGS # noqa pylint: disable=unused-import
3434
except ImportError:

src/aws_encryption_sdk_cli/internal/logging_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import json
1717
import logging
1818

19-
try: # Python 3.5.0 and 3.5.1 have incompatible typing modules
19+
try: # Python 3.5.0 and 3.5.1 have incompatible typing modules
2020
from typing import cast, Dict, Sequence, Text, Union # noqa pylint: disable=unused-import
2121
except ImportError:
2222
# We only actually need these imports when running the mypy checks

src/aws_encryption_sdk_cli/internal/master_key_parsing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from aws_encryption_sdk_cli.internal.identifiers import MASTER_KEY_PROVIDERS_ENTRY_POINT, PLUGIN_NAMESPACE_DIVIDER
2424
from aws_encryption_sdk_cli.internal.logging_utils import LOGGER_NAME
2525

26-
try: # Python 3.5.0 and 3.5.1 have incompatible typing modules
26+
try: # Python 3.5.0 and 3.5.1 have incompatible typing modules
2727
from typing import Callable, DefaultDict, Dict, List, Union # noqa pylint: disable=unused-import
2828
from aws_encryption_sdk_cli.internal.mypy_types import ( # noqa pylint: disable=unused-import
2929
CACHING_CONFIG, RAW_MASTER_KEY_PROVIDER_CONFIG

src/aws_encryption_sdk_cli/internal/metadata.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
from aws_encryption_sdk.internal.structures import MessageHeaderAuthentication # noqa pylint: disable=unused-import
2525
import six
2626

27-
try: # Python 3.5.0 and 3.5.1 have incompatible typing modules
27+
try: # Python 3.5.0 and 3.5.1 have incompatible typing modules
2828
from typing import Any, Dict, IO, Optional, Text # noqa pylint: disable=unused-import
2929
except ImportError:
3030
# We only actually need these imports when running the mypy checks

src/aws_encryption_sdk_cli/key_providers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from aws_encryption_sdk_cli.exceptions import BadUserArgumentError
2020
from aws_encryption_sdk_cli.internal.identifiers import USER_AGENT_SUFFIX
2121

22-
try: # Python 3.5.0 and 3.5.1 have incompatible typing modules
22+
try: # Python 3.5.0 and 3.5.1 have incompatible typing modules
2323
from typing import Dict, List, Text, Union # noqa pylint: disable=unused-import
2424
except ImportError:
2525
# We only actually need these imports when running the mypy checks

test/unit/test_encoding.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,18 @@ def test_base64io_decode_with_whitespace(plaintext_source, b64_plaintext_with_wh
266266
assert test == plaintext_source[:read_bytes]
267267

268268

269+
@pytest.mark.parametrize('plaintext_source, b64_plaintext_with_whitespace, read_bytes', (
270+
(b'\x00\x00\x00', b'AAAA', 3),
271+
))
272+
def test_base64io_decode_parametrized_null_bytes(plaintext_source, b64_plaintext_with_whitespace, read_bytes):
273+
# Verifies that pytest is handling null bytes correctly (broken in 3.3.0)
274+
# https://github.com/pytest-dev/pytest/issues/2957
275+
with Base64IO(io.BytesIO(b64_plaintext_with_whitespace)) as decoder:
276+
test = decoder.read(read_bytes)
277+
278+
assert test == plaintext_source[:read_bytes]
279+
280+
269281
def test_base64io_decode_read_only_from_buffer():
270282
plaintext_source = b'12345'
271283
plaintext_b64 = io.BytesIO(base64.b64encode(plaintext_source))

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ passenv =
3030
sitepackages = False
3131
deps =
3232
mock
33-
pytest
33+
pytest!=3.3.0
3434
pytest-catchlog
3535
pytest-cov
3636
pytest-mock

0 commit comments

Comments
 (0)