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

Fix portability of test execution PacketizerTest.test_closed_3 #862

Closed
sbz opened this Issue Dec 14, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@sbz
Contributor

sbz commented Dec 14, 2016

There are some platforms where Python doesn't defined the errno.ETIME, it results the execution of test PacketizerTest.test_closed_3 to raise an AttributeError because of the call

os.sterror(errno.ETIME) in file tests/test_packetizer.py#L119

As FreeBSD maintainer, I included a local fix into our ports and I would like to upstream this fix because it could also impact others platforms. I will submit a PR for that.

Ansible developers did similar fix here

I think it's better to not enforce the value of the message because Linux, OSX and al differs on ETIME definition.

After fixing all tests are completed successfully using make test :

===>  Testing for py35-paramiko-2.0.3
===>   py35-paramiko-2.0.3 depends on file: /usr/local/bin/python3.5 - found
............................................................................................................................................................................. 0s 0s ......... 1s 0s ......... 0s ......... 0s ......... ........ .........  .........  ...
----------------------------------------------------------------------
Ran 174 tests in 17.235s

OK

sbz added a commit to sbz/paramiko that referenced this issue Dec 14, 2016

Avoid PacketizerTest.test_closed_3 to fail on platforms where errno.E…
…TIME

is not defined

This changes define the proper Timer expired error message instead of raising
AttributeError when errno.ETIME is not available on the platform. fixes paramiko#862
@bitprophet

This comment has been minimized.

Member

bitprophet commented Dec 14, 2016

Thanks for the detailed report, let's just roll this into the PR ticket.

@bitprophet bitprophet closed this Dec 14, 2016

bitprophet added a commit that referenced this issue Feb 20, 2017

Avoid PacketizerTest.test_closed_3 to fail on platforms where errno.E…
…TIME

is not defined

This changes define the proper Timer expired error message instead of raising
AttributeError when errno.ETIME is not available on the platform. fixes #862

bitprophet added a commit that referenced this issue Feb 20, 2017

Avoid PacketizerTest.test_closed_3 to fail on platforms where errno.E…
…TIME

is not defined

This changes define the proper Timer expired error message instead of raising
AttributeError when errno.ETIME is not available on the platform. fixes #862
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment