Skip to content

Commit e027f0c

Browse files
Fix Windows test failures and remove debug prints for DRF (#9808)
1 parent fc17a60 commit e027f0c

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

tests/schemas/test_openapi.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,6 @@ class View(generics.GenericAPIView):
257257
inspector.view = view
258258

259259
request_body = inspector.get_request_body(path, method)
260-
print(request_body)
261260
assert request_body['content']['application/json']['schema']['$ref'] == '#/components/schemas/Item'
262261

263262
components = inspector.get_components(path, method)
@@ -928,7 +927,6 @@ def test_repeat_operation_ids(self):
928927
request = create_request('/')
929928
schema = generator.get_schema(request=request)
930929
schema_str = str(schema)
931-
print(schema_str)
932930
assert schema_str.count("operationId") == 2
933931
assert schema_str.count("newExample") == 1
934932
assert schema_str.count("oldExample") == 1
@@ -948,7 +946,6 @@ def test_duplicate_operation_id(self):
948946

949947
assert len(w) == 1
950948
assert issubclass(w[-1].category, UserWarning)
951-
print(str(w[-1].message))
952949
assert 'You have a duplicated operationId' in str(w[-1].message)
953950

954951
def test_operation_id_viewset(self):
@@ -960,7 +957,6 @@ def test_operation_id_viewset(self):
960957

961958
request = create_request('/')
962959
schema = generator.get_schema(request=request)
963-
print(schema)
964960
assert schema['paths']['/account/']['get']['operationId'] == 'listExampleViewSets'
965961
assert schema['paths']['/account/']['post']['operationId'] == 'createExampleViewSet'
966962
assert schema['paths']['/account/{id}/']['get']['operationId'] == 'retrieveExampleViewSet'
@@ -1284,8 +1280,6 @@ def test_serializer_model(self):
12841280
request = create_request('/')
12851281
schema = generator.get_schema(request=request)
12861282

1287-
print(schema)
1288-
12891283
assert 'components' in schema
12901284
assert 'schemas' in schema['components']
12911285
assert 'ExampleModel' in schema['components']['schemas']
@@ -1299,8 +1293,6 @@ def test_authtoken_serializer(self):
12991293
request = create_request('/')
13001294
schema = generator.get_schema(request=request)
13011295

1302-
print(schema)
1303-
13041296
route = schema['paths']['/api-token-auth/']['post']
13051297
body_schema = route['requestBody']['content']['application/json']['schema']
13061298

@@ -1327,7 +1319,6 @@ def test_component_name(self):
13271319
request = create_request('/')
13281320
schema = generator.get_schema(request=request)
13291321

1330-
print(schema)
13311322
assert 'components' in schema
13321323
assert 'schemas' in schema['components']
13331324
assert 'Ulysses' in schema['components']['schemas']

tests/test_model_serializer.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import decimal
1010
import json # noqa
1111
import re
12+
import sys
1213
import tempfile
1314

1415
import pytest
@@ -159,6 +160,7 @@ class Meta:
159160

160161

161162
class TestRegularFieldMappings(TestCase):
163+
@pytest.mark.skipif(sys.platform.startswith("win"), reason="Test not supported on Windows")
162164
def test_regular_fields(self):
163165
"""
164166
Model fields should map to their equivalent serializer fields.

0 commit comments

Comments
 (0)