3
3
import os
4
4
import sys
5
5
import pytest
6
+ import betterproto
7
+ from betterproto .tests .util import get_directories , inputs_path
6
8
7
9
# Force pure-python implementation instead of C++, otherwise imports
8
10
# break things because we can't properly reset the symbol database.
12
14
from google .protobuf .descriptor_pool import DescriptorPool
13
15
from google .protobuf .json_format import Parse
14
16
15
- import betterproto
16
- from betterproto .tests .util import get_directories , inputs_path
17
17
18
18
excluded_test_cases = {'googletypes_response' , 'service' }
19
19
test_case_names = {* get_directories (inputs_path )} - excluded_test_cases
@@ -50,13 +50,8 @@ def test_message_json(test_case_name: str) -> None:
50
50
message .from_json (reference_json_data )
51
51
message_json = message .to_json (0 )
52
52
53
- print (reference_json_data )
54
- print (message_json )
55
-
56
53
assert json .loads (reference_json_data ) == json .loads (message_json )
57
54
58
- # todo: handle -negative
59
-
60
55
61
56
@pytest .mark .parametrize ("test_case_name" , test_case_names )
62
57
def test_binary_compatibility (test_case_name : str ) -> None :
@@ -67,7 +62,6 @@ def test_binary_compatibility(test_case_name: str) -> None:
67
62
68
63
reference_module_root = os .path .join (* reference_output_package .split ('.' ), test_case_name )
69
64
70
- print (f'Appending { reference_module_root } ' )
71
65
sys .path .append (reference_module_root )
72
66
73
67
# import reference message
@@ -95,6 +89,7 @@ def test_binary_compatibility(test_case_name: str) -> None:
95
89
helper methods
96
90
'''
97
91
92
+
98
93
def get_test_case_json_data (test_case_name ):
99
94
test_data_path = os .path .join (inputs_path , test_case_name , f'{ test_case_name } .json' )
100
95
if not os .path .exists (test_data_path ):
0 commit comments