Skip to content

Commit b50a209

Browse files
committed
Fix broken tests
1 parent 95e8082 commit b50a209

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

azure-pipelines.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
- task: UsePythonVersion@0
88
displayName: Setup Python
99
inputs:
10-
versionSpec: '3.7.0'
10+
versionSpec: '3.7'
1111

1212
- template: azure-steps/install_deps.yml
1313

@@ -23,7 +23,7 @@ jobs:
2323
- task: UsePythonVersion@0
2424
displayName: Setup Python
2525
inputs:
26-
versionSpec: '3.7.0'
26+
versionSpec: '3.7'
2727

2828
- template: azure-steps/install_deps.yml
2929

@@ -40,7 +40,7 @@ jobs:
4040
python27:
4141
python.version: '2.7'
4242
python37:
43-
python.version: '3.7.0'
43+
python.version: '3.7'
4444

4545
steps:
4646
- template: azure-steps/test.yml
@@ -56,7 +56,7 @@ jobs:
5656
python27:
5757
python.version: '2.7'
5858
python37:
59-
python.version: '3.7.0'
59+
python.version: '3.7'
6060

6161
steps:
6262
- template: azure-steps/test.yml
@@ -72,7 +72,7 @@ jobs:
7272
python27:
7373
python.version: '2.7'
7474
python37:
75-
python.version: '3.7.0'
75+
python.version: '3.7'
7676

7777
steps:
7878
- template: azure-steps/test.yml
@@ -94,7 +94,7 @@ jobs:
9494
- task: UsePythonVersion@0
9595
displayName: Setup Python
9696
inputs:
97-
versionSpec: '3.7.0'
97+
versionSpec: '3.7'
9898

9999
- task: PyPIPublisher@0
100100
displayName: Package and Publish to PyPI

tests/test_errors.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ def test_parse(self):
3131
with pytest.raises(self.expected_exception_type) as exception_info:
3232
xml.parse_from_string(self.processor, self.xml_string)
3333

34-
actual_message = str(exception_info)
34+
actual_message = str(exception_info.value)
3535
assert actual_message.endswith(self.expected_message)
3636

3737
def test_serialize(self):
3838
"""Tests serializing with error message"""
3939
with pytest.raises(self.expected_exception_type) as exception_info:
4040
xml.serialize_to_string(self.processor, self.value)
4141

42-
actual_message = str(exception_info)
42+
actual_message = str(exception_info.value)
4343
assert actual_message.endswith(self.expected_message)
4444

4545

tests/test_hooks_validation.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,13 +238,14 @@ def _assert_error_message(processor, value, xml_string, expected_location):
238238
with pytest.raises(_ValidationError) as parse_exception:
239239
xml.parse_from_string(processor, xml_string)
240240

241-
actual_parse_message = str(parse_exception)
241+
actual_parse_message = str(parse_exception.value)
242+
print(actual_parse_message)
242243
assert actual_parse_message.endswith(expected_location)
243244

244245
with pytest.raises(_ValidationError) as serialize_exception:
245246
xml.serialize_to_string(processor, value)
246247

247-
actual_serialize_message = str(serialize_exception)
248+
actual_serialize_message = str(serialize_exception.value)
248249
assert actual_serialize_message.endswith(expected_location)
249250

250251
@property

0 commit comments

Comments
 (0)