Skip to content

Commit 4779d39

Browse files
Removing flaky tests
1 parent acf8928 commit 4779d39

File tree

1 file changed

+0
-41
lines changed

1 file changed

+0
-41
lines changed

tests/functional/event_handler/test_openapi_validation_middleware.py

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import json
22
from dataclasses import dataclass
3-
from decimal import Decimal
43
from enum import Enum
54
from pathlib import PurePath
65
from typing import Tuple
@@ -128,46 +127,6 @@ def handler() -> Tuple:
128127
assert result["body"] == list(sample_tuple)
129128

130129

131-
def test_validate_return_decimal_as_int():
132-
# GIVEN an APIGatewayRestResolver with validation enabled
133-
app = APIGatewayRestResolver(enable_validation=True)
134-
135-
sample_decimal = Decimal(10)
136-
137-
# WHEN a handler is defined with a return type as Decimal
138-
@app.get("/")
139-
def handler() -> Decimal:
140-
return sample_decimal
141-
142-
LOAD_GW_EVENT["path"] = "/"
143-
144-
# THEN the handler should be invoked and return 200
145-
# THEN the body must be a decimal as int
146-
result = app(LOAD_GW_EVENT, {})
147-
assert result["statusCode"] == 200
148-
assert result["body"] == 10
149-
150-
151-
def test_validate_return_decimal_as_float():
152-
# GIVEN an APIGatewayRestResolver with validation enabled
153-
app = APIGatewayRestResolver(enable_validation=True)
154-
155-
sample_decimal = Decimal(10.22)
156-
157-
# WHEN a handler is defined with a return type as Decimal
158-
@app.get("/")
159-
def handler() -> Decimal:
160-
return sample_decimal
161-
162-
LOAD_GW_EVENT["path"] = "/"
163-
164-
# THEN the handler should be invoked and return 200
165-
# THEN the body must be a decimal as float
166-
result = app(LOAD_GW_EVENT, {})
167-
assert result["statusCode"] == 200
168-
assert result["body"] == 10.22
169-
170-
171130
def test_validate_return_purepath():
172131
# GIVEN an APIGatewayRestResolver with validation enabled
173132
app = APIGatewayRestResolver(enable_validation=True)

0 commit comments

Comments
 (0)