-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Clean up unittest deprecations and warnings #2130
Conversation
Fixes getpcmd on macOS by calling 'pgrep' instead of reading '/proc', which is not available. This fixes two failures in lock_test. Also fixes an issue where UTF-8 process could not be hashed in Python 2.6.
Fixes "DeprecationWarning: Please use assertEqual instead."
Fixes noisy warnings during tests by using assertWarns() added in Python 3.
Fixes a number of deprecation warnings regarding configuration: test_config_summary_limit (execution_summary_test.ExecutionSummaryTest) ... DeprecationWarning: Configuration [execution_summary] summary_length (with dashes) should be avoided. Please use underscores. test_disable_emails (worker_test.WorkerEmailTest) ... DeprecationWarning: The use of the configuration [core] email-type is deprecated. Please use [email] format test_task_limit_exceeded (worker_test.TaskLimitTest) ... DeprecationWarning: The use of the configuration [core] worker-task-limit is deprecated. Please use [worker] task_limit test_complete_error (worker_test.WorkerEmailTest) ... DeprecationWarning: Configuration [email] force_send (with dashes) should be avoided. Please use underscores. test_scheduler_with_config (scheduler_test.SchedulerIoTest) ... DeprecationWarning: Configuration [scheduler] worker_disconnect_delay (with dashes) should be avoided. Please use underscores. test_sendgrid (notifications_test.TestNotificationDispatcher) ... DeprecationWarning: Configuration [email] force_send (with dashes) should be avoided. Please use underscores. DeprecationWarning: The use of the configuration [email] type is deprecated. Please use [email] method Call notificaions.send_email_smtp with fixture parameters with smtp_without_tls set to False ... DeprecationWarning: The use of the configuration [core] smtp_host is deprecated. Please use [smtp] host DeprecationWarning: The use of the configuration [core] smtp_local_hostname is deprecated. Please use [smtp] local_hostname ... Call notificaions.send_email_sendgrid with fixture parameters ... DeprecationWarning: The use of the configuration [email] SENDGRID_USERNAME is deprecated. Please use [sendgrid] username DeprecationWarning: The use of the configuration [email] SENDGRID_PASSWORD is deprecated. Please use [sendgrid] password
@xoob, thanks for your PR! By analyzing the history of the files in this pull request, we identified @Tarrasch, @erikbern and @daveFNbuck to be potential reviewers. |
else: | ||
cmd_hash = my_cmd | ||
|
||
cmd_hash = my_cmd.encode('utf8') |
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.
Hmm, now this causes breakage on Linux, py27: UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 4: ordinal not in range(128)
.
Would this change to line 52 be appropriate?
-return fh.read().replace('\0', ' ').rstrip()
+return fh.read().replace('\0', ' ').decode('utf8').rstrip()
Thank you so much!!! Can you just fix the flake8 error? (also check why py27 fails) |
@xoob, this is a really good PR which I would like to merge, can you just fix the flake8 error? |
I'll take a shot at it this weekend.
|
looks awesome! |
Fixes an issue where utf8 cmdline args where not consistently decoded in py27 on Linux. See also https://github.com/spotify/luigi/pull/2130/files#r118579419
The commit message quality was quite mixed, but overall I thought it might be useful to keep the whole commit history as some commits were particularly useful to be able to introspect in isolation. So did a rebase-merge here. :) Thanks a lot for this contribution. This greatly increases the code quality in luigi! |
@Tarrasch Which commit messages worked for you and how would you improve the other ones? |
@xoob good question! These are my opinion and they are by no means better than anyone else's:
Are any of these thoughts useful as feedback? :) |
@Tarrasch Very useful, thanks. I could have amended and force-pushed the last three commits (and possibly the flake8 changes too), which I'll do next time. Appreciate the feedback. |
Not everyone is so responsive to iterate on their commits. Thanks for your cooperation. ^^ |
This PR cleans up a number of warnings and notices in the tests. Detailed descriptions are in the commit messages.
Motivation and Context
Needed to get aquatinted with the test infrastructure. Aside from that, general maintenance and keeping things neat.
Have you tested this? If so, how?
Tested locally with
tox -e py36-nonhdfs
andtox -e py27-nonhdfs
.