{"action":"created","issue":{"url":"https://api.github.com/repos/epogrebnyak/rosstat-kep-data/issues/48","labels_url":"https://api.github.com/repos/epogrebnyak/rosstat-kep-data/issues/48/labels{/name}","comments_url":"https://api.github.com/repos/epogrebnyak/rosstat-kep-data/issues/48/comments","events_url":"https://api.github.com/repos/epogrebnyak/rosstat-kep-data/issues/48/events","html_url":"https://github.com/epogrebnyak/rosstat-kep-data/issues/48","id":120979136,"number":48,"title":"Writing temporary files in a test (fixture)","user":{"login":"epogrebnyak","id":9265326,"avatar_url":"https://avatars.githubusercontent.com/u/9265326?v=3","gravatar_id":"","url":"https://api.github.com/users/epogrebnyak","html_url":"https://github.com/epogrebnyak","followers_url":"https://api.github.com/users/epogrebnyak/followers","following_url":"https://api.github.com/users/epogrebnyak/following{/other_user}","gists_url":"https://api.github.com/users/epogrebnyak/gists{/gist_id}","starred_url":"https://api.github.com/users/epogrebnyak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/epogrebnyak/subscriptions","organizations_url":"https://api.github.com/users/epogrebnyak/orgs","repos_url":"https://api.github.com/users/epogrebnyak/repos","events_url":"https://api.github.com/users/epogrebnyak/events{/privacy}","received_events_url":"https://api.github.com/users/epogrebnyak/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"gabrielelanaro","id":239875,"avatar_url":"https://avatars.githubusercontent.com/u/239875?v=3","gravatar_id":"","url":"https://api.github.com/users/gabrielelanaro","html_url":"https://github.com/gabrielelanaro","followers_url":"https://api.github.com/users/gabrielelanaro/followers","following_url":"https://api.github.com/users/gabrielelanaro/following{/other_user}","gists_url":"https://api.github.com/users/gabrielelanaro/gists{/gist_id}","starred_url":"https://api.github.com/users/gabrielelanaro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabrielelanaro/subscriptions","organizations_url":"https://api.github.com/users/gabrielelanaro/orgs","repos_url":"https://api.github.com/users/gabrielelanaro/repos","events_url":"https://api.github.com/users/gabrielelanaro/events{/privacy}","received_events_url":"https://api.github.com/users/gabrielelanaro/received_events","type":"User","site_admin":false},"milestone":null,"comments":6,"created_at":"2015-12-08T10:31:55Z","updated_at":"2015-12-13T21:26:27Z","closed_at":null,"body":"(Note: use as_package branch.)\r\n\r\nI'm in root folder of this repo (rosstat-kep-data), and I call **test_yaml_import.py** \r\nby any of below:\r\n\r\n```\r\nset PYTHONPATH=.\r\npy.test kep/test/test_yaml_import.py\r\n```\r\nor \r\n```\r\npython -m kep.test.test_yaml_import\r\n```\r\n\r\ntest_yaml_import.py uses kep.io.docstring_to_file() to write temporarily files \r\nused in this test, essentially a fixture for the test.\r\n\r\n1. When doing the call above test_yaml_import.test_with_file() will write \r\n_yaml_spec_sample.txt to root folder of the repo, read it back and pass the test.\r\nDesired behaviour is to write _yaml_spec_sample.txt to kep/test/temp/_yaml_spec_sample.txt.\r\nNeed a solution for this without changing test_yaml_import.py structure much.\r\n\r\n2. Using temporarily files to run a test seems a feature of py.test as a package.\r\nHow would you implement same behaviour using a fixture. (Note: this part I know little about - additional advice/explainations welcome.)\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/epogrebnyak/rosstat-kep-data/issues/comments/164299670","html_url":"https://github.com/epogrebnyak/rosstat-kep-data/issues/48#issuecomment-164299670","issue_url":"https://api.github.com/repos/epogrebnyak/rosstat-kep-data/issues/48","id":164299670,"user":{"login":"epogrebnyak","id":9265326,"avatar_url":"https://avatars.githubusercontent.com/u/9265326?v=3","gravatar_id":"","url":"https://api.github.com/users/epogrebnyak","html_url":"https://github.com/epogrebnyak","followers_url":"https://api.github.com/users/epogrebnyak/followers","following_url":"https://api.github.com/users/epogrebnyak/following{/other_user}","gists_url":"https://api.github.com/users/epogrebnyak/gists{/gist_id}","starred_url":"https://api.github.com/users/epogrebnyak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/epogrebnyak/subscriptions","organizations_url":"https://api.github.com/users/epogrebnyak/orgs","repos_url":"https://api.github.com/users/epogrebnyak/repos","events_url":"https://api.github.com/users/epogrebnyak/events{/privacy}","received_events_url":"https://api.github.com/users/epogrebnyak/received_events","type":"User","site_admin":false},"created_at":"2015-12-13T21:26:27Z","updated_at":"2015-12-13T21:26:27Z","body":"Remaining question - is this solution for cleanup ok:\r\n\r\nhttps://github.com/epogrebnyak/rosstat-kep-data/blob/master/kep/test/test_label_csv.py#L36-L37\r\n"}}