{"action":"created","issue":{"url":"https://api.github.com/repos/pytest-dev/pytest/issues/2715","repository_url":"https://api.github.com/repos/pytest-dev/pytest","labels_url":"https://api.github.com/repos/pytest-dev/pytest/issues/2715/labels{/name}","comments_url":"https://api.github.com/repos/pytest-dev/pytest/issues/2715/comments","events_url":"https://api.github.com/repos/pytest-dev/pytest/issues/2715/events","html_url":"https://github.com/pytest-dev/pytest/issues/2715","id":252394852,"number":2715,"title":"pytest inexplicably removing `print` statements","user":{"login":"jamesob","id":73197,"avatar_url":"https://avatars0.githubusercontent.com/u/73197?v=4","gravatar_id":"","url":"https://api.github.com/users/jamesob","html_url":"https://github.com/jamesob","followers_url":"https://api.github.com/users/jamesob/followers","following_url":"https://api.github.com/users/jamesob/following{/other_user}","gists_url":"https://api.github.com/users/jamesob/gists{/gist_id}","starred_url":"https://api.github.com/users/jamesob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamesob/subscriptions","organizations_url":"https://api.github.com/users/jamesob/orgs","repos_url":"https://api.github.com/users/jamesob/repos","events_url":"https://api.github.com/users/jamesob/events{/privacy}","received_events_url":"https://api.github.com/users/jamesob/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-08-23T19:44:40Z","updated_at":"2017-08-23T19:57:35Z","closed_at":null,"body":"## `pip list`\r\n```\r\n $ docker-compose run --rm test pip list --format=columns | grep pytest\r\n\r\npytest                     3.0.7\r\npytest-django              3.1.2\r\npytest-profiling           1.2.6\r\n```\r\n\r\n## The problem\r\n\r\npy.test is removing `print` statements from the AST for seemingly no reason.\r\n\r\n### What's in my editor\r\n\r\n```python\r\ndef test_user_ids_still_working():\r\n    yo = _create_fake_step_activity(JobStepActivity.started_work.value, user_id=0)\r\n    print(yo or \"OMG\")  # !!! this will be absent from what py.test ran\r\n\r\n    salist = [ yo, ]\r\n\r\n    assert api.user_ids_still_working(salist) == [0]\r\n```\r\n\r\n### What py.test runs\r\n\r\n```\r\n_________________________ test_user_ids_still_working __________________________\r\n\r\n    def test_user_ids_still_working():\r\n        yo = _create_fake_step_activity(JobStepActivity.started_work.value, user_id=0)\r\n\r\n        salist = [ yo, ]\r\n\r\n>       assert api.user_ids_still_working(salist) == [0]\r\nE       assert [] == [0]\r\nE         Right contains more items, first extra item: 0\r\nE         - []\r\nE         + [0]\r\nE         ?  +\r\n\r\nproject/tests/test_api.py:86: AssertionError\r\n```\r\nLine 2 of the function is missing for reasons I can't discern. If I try to drop a `pdb.set_trace` into the function, I'm unable to get the value of `yo`. \r\n\r\nDoes anyone have any idea what's going on?"},"comment":{"url":"https://api.github.com/repos/pytest-dev/pytest/issues/comments/324445190","html_url":"https://github.com/pytest-dev/pytest/issues/2715#issuecomment-324445190","issue_url":"https://api.github.com/repos/pytest-dev/pytest/issues/2715","id":324445190,"user":{"login":"The-Compiler","id":625793,"avatar_url":"https://avatars0.githubusercontent.com/u/625793?v=4","gravatar_id":"","url":"https://api.github.com/users/The-Compiler","html_url":"https://github.com/The-Compiler","followers_url":"https://api.github.com/users/The-Compiler/followers","following_url":"https://api.github.com/users/The-Compiler/following{/other_user}","gists_url":"https://api.github.com/users/The-Compiler/gists{/gist_id}","starred_url":"https://api.github.com/users/The-Compiler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/The-Compiler/subscriptions","organizations_url":"https://api.github.com/users/The-Compiler/orgs","repos_url":"https://api.github.com/users/The-Compiler/repos","events_url":"https://api.github.com/users/The-Compiler/events{/privacy}","received_events_url":"https://api.github.com/users/The-Compiler/received_events","type":"User","site_admin":false},"created_at":"2017-08-23T19:57:35Z","updated_at":"2017-08-23T19:57:35Z","body":"I can't reproduce this with `platform linux -- Python 3.6.2, pytest-3.0.7, py-1.4.34, pluggy-0.4.0`.\r\n\r\nCan you try:\r\n\r\n- without those plugins\r\n- in another environment without e.g. your `conftest.py` and other tests being collected\r\n- with a more up-to-date pytest?"}}
{"actor":{"display_login":"The-Compiler"}}