{"action":"created","issue":{"url":"https://api.github.com/repos/pytest-dev/pytest/issues/1435","repository_url":"https://api.github.com/repos/pytest-dev/pytest","labels_url":"https://api.github.com/repos/pytest-dev/pytest/issues/1435/labels{/name}","comments_url":"https://api.github.com/repos/pytest-dev/pytest/issues/1435/comments","events_url":"https://api.github.com/repos/pytest-dev/pytest/issues/1435/events","html_url":"https://github.com/pytest-dev/pytest/issues/1435","id":138426654,"number":1435,"title":"Path in pytest options distracts pytest.ini discovery","user":{"login":"matthiasha","id":1838091,"avatar_url":"https://avatars.githubusercontent.com/u/1838091?v=3","gravatar_id":"","url":"https://api.github.com/users/matthiasha","html_url":"https://github.com/matthiasha","followers_url":"https://api.github.com/users/matthiasha/followers","following_url":"https://api.github.com/users/matthiasha/following{/other_user}","gists_url":"https://api.github.com/users/matthiasha/gists{/gist_id}","starred_url":"https://api.github.com/users/matthiasha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthiasha/subscriptions","organizations_url":"https://api.github.com/users/matthiasha/orgs","repos_url":"https://api.github.com/users/matthiasha/repos","events_url":"https://api.github.com/users/matthiasha/events{/privacy}","received_events_url":"https://api.github.com/users/matthiasha/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/pytest-dev/pytest/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/pytest-dev/pytest/labels/critical","name":"critical","color":"e11d21"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":15,"created_at":"2016-03-04T09:30:16Z","updated_at":"2016-08-16T12:35:49Z","closed_at":null,"body":"Please find the minimal source code example for reproducing in [Archive.zip](https://github.com/pytest-dev/pytest/files/158427/Archive.zip).\r\n\r\nWithout CLI options, the pytest.ini is found (first assertion in the test passes):\r\n````\r\n❯❯❯ py.test                             ⏎\r\n================================= test session starts =================================\r\nplatform linux2 -- Python 2.7.9, pytest-2.9.0, py-1.4.31, pluggy-0.3.1\r\nrootdir: /Users/mzhafn/tmp/pytest-new, inifile: pytest.ini\r\ncollected 1 items\r\n\r\ntest_test.py F\r\n\r\n====================================== FAILURES =======================================\r\n______________________________________ test_test ______________________________________\r\n\r\n    def test_test():\r\n        assert pytest.config.option.pytest_ini_option == 'set_value'\r\n>       assert pytest.config.option.cli_option == '../../test.log'\r\nE       assert 'unset' == '../../test.log'\r\nE         - unset\r\nE         + ../../test.log\r\n\r\ntest_test.py:6: AssertionError\r\n============================== 1 failed in 0.04 seconds ===============================\r\n````\r\n\r\nWith a path that is part of a custom py.test CLI option, pytest.ini discovery fails:\r\n````\r\n❯❯❯ py.test --cli-option ../../test.log\r\n================================= test session starts =================================\r\nplatform linux2 -- Python 2.7.9, pytest-2.9.0, py-1.4.31, pluggy-0.3.1\r\nrootdir: /Users/mzhafn, inifile:\r\ncollected 1 items\r\n\r\ntest_test.py F\r\n\r\n====================================== FAILURES =======================================\r\n______________________________________ test_test ______________________________________\r\n\r\n    def test_test():\r\n>       assert pytest.config.option.pytest_ini_option == 'set_value'\r\nE       assert 'unset' == 'set_value'\r\nE         - unset\r\nE         + set_value\r\n\r\ntest_test.py:5: AssertionError\r\n============================== 1 failed in 0.04 seconds ===============================\r\n````\r\n\r\nplatform linux2 -- Python 2.7.9, pytest-2.9.0, py-1.4.31, pluggy-0.3.1\r\nLinux mzhafn-mb-ubuntu 3.19.0-43-generic #49-Ubuntu SMP Sun Dec 27 19:43:07 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux\r\nDistributor ID:\tUbuntu\r\nDescription:\tUbuntu 15.04\r\nRelease:\t15.04\r\nCodename:\tvivid\r\n\r\ncheck-manifest (0.31)\r\ndevpi-client (2.1.0)\r\ndevpi-common (2.0.8)\r\npip (7.1.2)\r\npkginfo (1.2.1)\r\npluggy (0.3.1)\r\npy (1.4.31)\r\npytest (2.9.0)\r\nrequests (2.9.1)\r\nsetuptools (20.2.2)\r\ntox (2.3.1)\r\nvirtualenv (14.0.6)"},"comment":{"url":"https://api.github.com/repos/pytest-dev/pytest/issues/comments/240088577","html_url":"https://github.com/pytest-dev/pytest/issues/1435#issuecomment-240088577","issue_url":"https://api.github.com/repos/pytest-dev/pytest/issues/1435","id":240088577,"user":{"login":"nicoddemus","id":1085180,"avatar_url":"https://avatars.githubusercontent.com/u/1085180?v=3","gravatar_id":"","url":"https://api.github.com/users/nicoddemus","html_url":"https://github.com/nicoddemus","followers_url":"https://api.github.com/users/nicoddemus/followers","following_url":"https://api.github.com/users/nicoddemus/following{/other_user}","gists_url":"https://api.github.com/users/nicoddemus/gists{/gist_id}","starred_url":"https://api.github.com/users/nicoddemus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicoddemus/subscriptions","organizations_url":"https://api.github.com/users/nicoddemus/orgs","repos_url":"https://api.github.com/users/nicoddemus/repos","events_url":"https://api.github.com/users/nicoddemus/events{/privacy}","received_events_url":"https://api.github.com/users/nicoddemus/received_events","type":"User","site_admin":false},"created_at":"2016-08-16T12:35:49Z","updated_at":"2016-08-16T12:35:49Z","body":"@matthiasha good point. It is unfortunately ambiguous as it is. I guess if #1642 is implemented at least we could document that as a workaround that would allow passing paths to command-line options which wouldn't be considered to determine the `rootdir`, because the `rootdir` as being explicitly configured by the user in that scenario.\r\n\r\nEither way documenting the current behavior seems to be a good option. Would you care to open a PR? :grin: "}}
{"actor":{"display_login":"nicoddemus"}}