{"action":"created","issue":{"url":"https://api.github.com/repos/txels/ddt/issues/38","repository_url":"https://api.github.com/repos/txels/ddt","labels_url":"https://api.github.com/repos/txels/ddt/issues/38/labels{/name}","comments_url":"https://api.github.com/repos/txels/ddt/issues/38/comments","events_url":"https://api.github.com/repos/txels/ddt/issues/38/events","html_url":"https://github.com/txels/ddt/issues/38","id":117859291,"number":38,"title":"Breaking behavior in latest release (1.0.1)","user":{"login":"Kuwagata","id":794740,"avatar_url":"https://avatars.githubusercontent.com/u/794740?v=3","gravatar_id":"","url":"https://api.github.com/users/Kuwagata","html_url":"https://github.com/Kuwagata","followers_url":"https://api.github.com/users/Kuwagata/followers","following_url":"https://api.github.com/users/Kuwagata/following{/other_user}","gists_url":"https://api.github.com/users/Kuwagata/gists{/gist_id}","starred_url":"https://api.github.com/users/Kuwagata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kuwagata/subscriptions","organizations_url":"https://api.github.com/users/Kuwagata/orgs","repos_url":"https://api.github.com/users/Kuwagata/repos","events_url":"https://api.github.com/users/Kuwagata/events{/privacy}","received_events_url":"https://api.github.com/users/Kuwagata/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-11-19T17:05:59Z","updated_at":"2016-06-01T19:20:37Z","closed_at":null,"body":"A change in the latest release of ddt (#22 included in 1.0.1) has seemingly introduced breaking behavior for wrapped tests expecting a dictionary object when receiving test data, as exemplified below:\r\n\r\ntest_data.json\r\n```json\r\n{\r\n  \"test_name\": {\r\n    \"arg_one\": \"test1\",\r\n    \"arg_two\": \"test2\",\r\n    \"arg_three\": \"test3\"\r\n  }\r\n}\r\n```\r\n\r\nOriginal test code:\r\n```python\r\n@ddt.file_data('test_data.json')\r\ndef test_something(inputs):\r\n    arg_one = inputs[\"arg_one\"]\r\n    arg_two = inputs[\"arg_two\"]\r\n    arg_three = inputs[\"arg_three\"]\r\n    # Perform tests here\r\n    pass\r\n```\r\n\r\nNew test code:\r\n```python\r\n@ddt.file_data('test_data.json')\r\ndef test_something(arg_one, arg_two, arg_three):\r\n    # Perform tests here\r\n    pass\r\n```\r\n\r\nSince this behavior appears to be non-configurable and backward-incompatible, this seems more like a [major version change](http://semver.org/) rather than a simple patch.  Can this change be reverted at least for the time being?\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/txels/ddt/issues/comments/223097083","html_url":"https://github.com/txels/ddt/issues/38#issuecomment-223097083","issue_url":"https://api.github.com/repos/txels/ddt/issues/38","id":223097083,"user":{"login":"BenjamenMeyer","id":1074110,"avatar_url":"https://avatars.githubusercontent.com/u/1074110?v=3","gravatar_id":"","url":"https://api.github.com/users/BenjamenMeyer","html_url":"https://github.com/BenjamenMeyer","followers_url":"https://api.github.com/users/BenjamenMeyer/followers","following_url":"https://api.github.com/users/BenjamenMeyer/following{/other_user}","gists_url":"https://api.github.com/users/BenjamenMeyer/gists{/gist_id}","starred_url":"https://api.github.com/users/BenjamenMeyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BenjamenMeyer/subscriptions","organizations_url":"https://api.github.com/users/BenjamenMeyer/orgs","repos_url":"https://api.github.com/users/BenjamenMeyer/repos","events_url":"https://api.github.com/users/BenjamenMeyer/events{/privacy}","received_events_url":"https://api.github.com/users/BenjamenMeyer/received_events","type":"User","site_admin":false},"created_at":"2016-06-01T19:20:37Z","updated_at":"2016-06-01T19:20:37Z","body":"In all honesty, looking at PR #22 which is what seems to have caused this issue I would really suggest outright reverting #22 and then just telling people to break down the dictionary themselves. There's nothing stopping them from using a dictionary to manage how many entries they have and splitting it out doesn't really add much code to test.\r\n\r\nThough if they really want to keep PR #22's functionality, perhaps it shouldn't be part of `unpack` but it's own `unpack_dict` to make that kind of functionality explicit.\r\n\r\n@pradyunsg sorry...I'm not really seeing benefit to your proposed migration as it seems lacking in matching up arguments especially due to the assumption that a test that previously worked (as @Kuwagata exemplified) would only have 1 parameter, and thinking it through it would seem to me at least not an easy problem to try to determine how many parameters should be able to be matched up. So making the dict unpacking done via its own specific decorator would seem to be the most logical path. Anyone that has come to rely on the new methodology should be able to migrate easily to using a new decorator, which is what you're asking people that have been using the old methodology to do any way. And my guess is that people using the new method are probably fewer in number than people using the new method."}}
{"actor":{"display_login":"BenjamenMeyer"}}