File tree 3 files changed +13
-14
lines changed
src/opentelemetry/configuration
3 files changed +13
-14
lines changed Original file line number Diff line number Diff line change 2
2
3
3
## Unreleased
4
4
5
+ - Store ` int ` s as ` int ` s in the global Configuration object
6
+ ([ #1118 ] ( https://github.com/open-telemetry/opentelemetry-python/pull/1118 ) )
7
+
5
8
## Version 0.13b0
6
9
7
10
Released 2020-09-17
Original file line number Diff line number Diff line change @@ -128,11 +128,10 @@ def __new__(cls) -> "Configuration":
128
128
try :
129
129
value = int (value_str )
130
130
except ValueError :
131
- pass
132
- try :
133
- value = float (value_str )
134
- except ValueError :
135
- pass
131
+ try :
132
+ value = float (value_str )
133
+ except ValueError :
134
+ pass
136
135
137
136
instance ._config_map [key ] = value
138
137
Original file line number Diff line number Diff line change @@ -119,15 +119,12 @@ def test_boolean(self) -> None:
119
119
},
120
120
)
121
121
def test_integer (self ) -> None :
122
- self .assertEqual (
123
- Configuration ().POSITIVE_INTEGER , 123
124
- ) # pylint: disable=no-member
125
- self .assertEqual (
126
- Configuration ().NEGATIVE_INTEGER , - 123
127
- ) # pylint: disable=no-member
128
- self .assertEqual (
129
- Configuration ().NON_INTEGER , "-12z3"
130
- ) # pylint: disable=no-member
122
+ # pylint: disable=no-member
123
+ self .assertIsInstance (Configuration ().POSITIVE_INTEGER , int )
124
+ self .assertEqual (Configuration ().POSITIVE_INTEGER , 123 )
125
+ self .assertIsInstance (Configuration ().NEGATIVE_INTEGER , int )
126
+ self .assertEqual (Configuration ().NEGATIVE_INTEGER , - 123 )
127
+ self .assertEqual (Configuration ().NON_INTEGER , "-12z3" )
131
128
132
129
@patch .dict (
133
130
"os.environ" , # type: ignore
You can’t perform that action at this time.
0 commit comments