-
Notifications
You must be signed in to change notification settings - Fork 660
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Store ints as ints in the configuration object #1119
Conversation
self.assertEqual(Configuration().POSITIVE_INTEGER, 123) | ||
self.assertTrue(isinstance(Configuration().NEGATIVE_INTEGER, int)) | ||
self.assertEqual(Configuration().NEGATIVE_INTEGER, -123) | ||
self.assertEqual(Configuration().NON_INTEGER, "-12z3") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious how these tests passed before this change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before, we didn't have tests that checked type
(added them here with isinstance
). And this:
Python 3.8.3 (default, Jun 29 2020, 18:03:36)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.16.1 -- An enhanced Interactive Python. Type '?' for help.
In [1]: 1 == 1.0
Out[1]: True
In [2]:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahhhhh right, that makes sense now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just minor nits
Fixes open-telemetry#1118 Co-authored-by: alrex <aboten@lightstep.com>
Description
The configuration object currently stores
"2"
as"2.0"
. This change makes it store that value as"2"
.Fixes #1118
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Updated test to specifically test this change.
test_integer
Checklist: