-
Notifications
You must be signed in to change notification settings - Fork 42
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
Python 3 support fix on _send method #71
base: master
Are you sure you want to change the base?
Conversation
Python 3 support fix on _send method
@daniellawrence travis errors are not from the commit i made, can you give me a hand? Thanks in advance! |
@PabloLefort I fixed the issue you were facing with the tests. However, the coverage decrease with your commit so could you please add a test to make it at least the same as now. Also, please note that an other ongoing PR (#70) is trying to fix a Python 3 issue and I think it's the same issue. Can you please explain what was the issue you were facing ? Our Python 3 test suite is passing so I don't understand what could be the error. I like the fact that the PR #70 is regardless of the python version. But I also like the simplicity of your PR. You could still make it simpler by using an |
@Shir0kamii thanks for the tests! Yes, i can make a test for the coverage. The problem was that sending a test metric Your suggest is even more simpler! I'll update it. |
1 similar comment
@PabloLefort Agreed! Once you make the coverage stage pass, I'll merge your pull request. |
@Shir0kamii It could be something like this? def test_send_values_as_bytes(self):
graphite_instance = graphitesend.init()
metric = 'metric'
if sys.version_info >= (3, 0) and type(metric) is bytes:
metric = str(metric, 'utf-8')
response = graphite_instance.send(metric, "1", "1")
response = str(response)
self.assertEqual('metric 1.000000 1' in response, True) Thank you! |
@PabloLefort I'm not sure it would increase the coverage. Coverage is just a tool verifying that every line of code is executed. So to increase coverage you will need to make sure the test you write execute the lines of code you added. It means that you will have to Also because your code will only ever be executed on Python 3, you won't be able to increase Python 2's coverage. But that's okay, I'll merge it if Python 3 pass coverage test. |
@Shir0kamii Thanks! I'll update the test tonight. |
Running a
Django v1.10
app withPython v3.4.3
, the _send method breaks.Stack trace: