Skip to content

Commit 0668295

Browse files
committed
Fix code layout in tests/unit/schema/test_integration_py36.py
1 parent 142b919 commit 0668295

File tree

2 files changed

+54
-47
lines changed

2 files changed

+54
-47
lines changed

docs/main/changelog.rst

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Development
1717
Thanks to `@illia-v (Illia Volochii) <https://github.com/illia-v>`_ for the
1818
PR (`#580 <https://github.com/ets-labs/python-dependency-injector/pull/580>`_).
1919
- Update copyright year.
20+
- Enable skipped test ``test_schema_with_boto3_session()``.
2021
- Update pytest configuration.
2122
- Regenerate C sources using Cython 0.29.30.
2223

tests/unit/schema/test_integration_py36.py

+53-47
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import sqlite3
55

66
from dependency_injector import containers
7-
from pytest import mark
87

98
from samples.schema.services import UserService, AuthService, PhotoService
109

@@ -19,18 +18,20 @@
1918

2019
def test_single_container_schema(container: containers.DynamicContainer):
2120
container.from_yaml_schema(f"{SAMPLES_DIR}/schema/container-single.yml")
22-
container.config.from_dict({
23-
"database": {
24-
"dsn": ":memory:",
25-
},
26-
"aws": {
27-
"access_key_id": "KEY",
28-
"secret_access_key": "SECRET",
29-
},
30-
"auth": {
31-
"token_ttl": 3600,
32-
},
33-
})
21+
container.config.from_dict(
22+
{
23+
"database": {
24+
"dsn": ":memory:",
25+
},
26+
"aws": {
27+
"access_key_id": "KEY",
28+
"secret_access_key": "SECRET",
29+
},
30+
"auth": {
31+
"token_ttl": 3600,
32+
},
33+
},
34+
)
3435

3536
# User service
3637
user_service1 = container.user_service()
@@ -79,18 +80,20 @@ def test_single_container_schema(container: containers.DynamicContainer):
7980

8081
def test_multiple_containers_schema(container: containers.DynamicContainer):
8182
container.from_yaml_schema(f"{SAMPLES_DIR}/schema/container-multiple.yml")
82-
container.core.config.from_dict({
83-
"database": {
84-
"dsn": ":memory:",
85-
},
86-
"aws": {
87-
"access_key_id": "KEY",
88-
"secret_access_key": "SECRET",
89-
},
90-
"auth": {
91-
"token_ttl": 3600,
83+
container.core.config.from_dict(
84+
{
85+
"database": {
86+
"dsn": ":memory:",
87+
},
88+
"aws": {
89+
"access_key_id": "KEY",
90+
"secret_access_key": "SECRET",
91+
},
92+
"auth": {
93+
"token_ttl": 3600,
94+
},
9295
},
93-
})
96+
)
9497

9598
# User service
9699
user_service1 = container.services.user()
@@ -139,18 +142,20 @@ def test_multiple_containers_schema(container: containers.DynamicContainer):
139142

140143
def test_multiple_reordered_containers_schema(container: containers.DynamicContainer):
141144
container.from_yaml_schema(f"{SAMPLES_DIR}/schema/container-multiple-reordered.yml")
142-
container.core.config.from_dict({
143-
"database": {
144-
"dsn": ":memory:",
145-
},
146-
"aws": {
147-
"access_key_id": "KEY",
148-
"secret_access_key": "SECRET",
149-
},
150-
"auth": {
151-
"token_ttl": 3600,
145+
container.core.config.from_dict(
146+
{
147+
"database": {
148+
"dsn": ":memory:",
149+
},
150+
"aws": {
151+
"access_key_id": "KEY",
152+
"secret_access_key": "SECRET",
153+
},
154+
"auth": {
155+
"token_ttl": 3600,
156+
},
152157
},
153-
})
158+
)
154159

155160
# User service
156161
user_service1 = container.services.user()
@@ -199,18 +204,20 @@ def test_multiple_reordered_containers_schema(container: containers.DynamicConta
199204

200205
def test_multiple_containers_with_inline_providers_schema(container: containers.DynamicContainer):
201206
container.from_yaml_schema(f"{SAMPLES_DIR}/schema/container-multiple-inline.yml")
202-
container.core.config.from_dict({
203-
"database": {
204-
"dsn": ":memory:",
205-
},
206-
"aws": {
207-
"access_key_id": "KEY",
208-
"secret_access_key": "SECRET",
209-
},
210-
"auth": {
211-
"token_ttl": 3600,
207+
container.core.config.from_dict(
208+
{
209+
"database": {
210+
"dsn": ":memory:",
211+
},
212+
"aws": {
213+
"access_key_id": "KEY",
214+
"secret_access_key": "SECRET",
215+
},
216+
"auth": {
217+
"token_ttl": 3600,
218+
},
212219
},
213-
})
220+
)
214221

215222
# User service
216223
user_service1 = container.services.user()
@@ -257,7 +264,6 @@ def test_multiple_containers_with_inline_providers_schema(container: containers.
257264
assert photo_service2.s3 is container.gateways.s3_client()
258265

259266

260-
@mark.skip(reason="Boto3 tries to connect to the internet")
261267
def test_schema_with_boto3_session(container: containers.DynamicContainer):
262268
container.from_yaml_schema(f"{SAMPLES_DIR}/schema/container-boto3-session.yml")
263269
container.config.from_dict(

0 commit comments

Comments
 (0)