{"action":"created","comment":{"url":"https://api.github.com/repos/onefinestay/nameko/pulls/comments/42412161","id":42412161,"diff_hunk":"@@ -84,30 +84,51 @@ def rabbit_manager(request):\n \n @pytest.yield_fixture()\n def rabbit_config(request, rabbit_manager):\n+    import random\n+    import string\n     from kombu import pools\n-    from nameko.testing.utils import (\n-        reset_rabbit_vhost, reset_rabbit_connections,\n-        get_rabbit_connections, get_rabbit_config)\n+    from nameko.testing.utils import get_rabbit_connections\n+    from six.moves.urllib.parse import urlparse  # pylint: disable=E0611\n \n     amqp_uri = request.config.getoption('AMQP_URI')\n \n-    conf = get_rabbit_config(amqp_uri)\n+    uri = urlparse(amqp_uri)\n+    username = uri.username\n+    vhost = uri.path[1:]\n \n-    reset_rabbit_connections(conf['vhost'], rabbit_manager)\n-    reset_rabbit_vhost(conf['vhost'], conf['username'], rabbit_manager)\n+    use_random_vost = vhost == \":random:\"\n+\n+    if use_random_vost:\n+        vhost = \"test_{}\".format(\n+            \"\".join(random.choice(string.lowercase) for _ in range(10))\n+        )\n+        amqp_uri = amqp_uri.replace(\":random:\", vhost)","path":"nameko/testing/pytest.py","position":46,"original_position":46,"commit_id":"f15822e7c669a8424debe9c457e3409102e8992d","original_commit_id":"f15822e7c669a8424debe9c457e3409102e8992d","user":{"login":"davidszotten","id":412005,"avatar_url":"https://avatars.githubusercontent.com/u/412005?v=3","gravatar_id":"","url":"https://api.github.com/users/davidszotten","html_url":"https://github.com/davidszotten","followers_url":"https://api.github.com/users/davidszotten/followers","following_url":"https://api.github.com/users/davidszotten/following{/other_user}","gists_url":"https://api.github.com/users/davidszotten/gists{/gist_id}","starred_url":"https://api.github.com/users/davidszotten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidszotten/subscriptions","organizations_url":"https://api.github.com/users/davidszotten/orgs","repos_url":"https://api.github.com/users/davidszotten/repos","events_url":"https://api.github.com/users/davidszotten/events{/privacy}","received_events_url":"https://api.github.com/users/davidszotten/received_events","type":"User","site_admin":false},"body":"above you parse the url to explicitly compare the value for vhost to `':random:'`, but here your run the replace over the whole string. seems inconsistent. ","created_at":"2015-10-19T19:02:22Z","updated_at":"2015-10-19T19:02:22Z","html_url":"https://github.com/onefinestay/nameko/pull/288#discussion_r42412161","pull_request_url":"https://api.github.com/repos/onefinestay/nameko/pulls/288","_links":{"self":{"href":"https://api.github.com/repos/onefinestay/nameko/pulls/comments/42412161"},"html":{"href":"https://github.com/onefinestay/nameko/pull/288#discussion_r42412161"},"pull_request":{"href":"https://api.github.com/repos/onefinestay/nameko/pulls/288"}}},"pull_request":{"url":"https://api.github.com/repos/onefinestay/nameko/pulls/288","id":48095974,"html_url":"https://github.com/onefinestay/nameko/pull/288","diff_url":"https://github.com/onefinestay/nameko/pull/288.diff","patch_url":"https://github.com/onefinestay/nameko/pull/288.patch","issue_url":"https://api.github.com/repos/onefinestay/nameko/issues/288","number":288,"state":"open","locked":false,"title":"Random vhost","user":{"login":"mattbennett","id":107611,"avatar_url":"https://avatars.githubusercontent.com/u/107611?v=3","gravatar_id":"","url":"https://api.github.com/users/mattbennett","html_url":"https://github.com/mattbennett","followers_url":"https://api.github.com/users/mattbennett/followers","following_url":"https://api.github.com/users/mattbennett/following{/other_user}","gists_url":"https://api.github.com/users/mattbennett/gists{/gist_id}","starred_url":"https://api.github.com/users/mattbennett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattbennett/subscriptions","organizations_url":"https://api.github.com/users/mattbennett/orgs","repos_url":"https://api.github.com/users/mattbennett/repos","events_url":"https://api.github.com/users/mattbennett/events{/privacy}","received_events_url":"https://api.github.com/users/mattbennett/received_events","type":"User","site_admin":false},"body":"Addresses https://github.com/onefinestay/nameko/issues/278\r\n\r\n@davidszotten please review","created_at":"2015-10-19T16:40:30Z","updated_at":"2015-10-19T19:02:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f5af3d6995a54c82f75250646c02ef644944d53d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/onefinestay/nameko/pulls/288/commits","review_comments_url":"https://api.github.com/repos/onefinestay/nameko/pulls/288/comments","review_comment_url":"https://api.github.com/repos/onefinestay/nameko/pulls/comments{/number}","comments_url":"https://api.github.com/repos/onefinestay/nameko/issues/288/comments","statuses_url":"https://api.github.com/repos/onefinestay/nameko/statuses/f15822e7c669a8424debe9c457e3409102e8992d","head":{"label":"mattbennett:random-vhost","ref":"random-vhost","sha":"f15822e7c669a8424debe9c457e3409102e8992d","user":{"login":"mattbennett","id":107611,"avatar_url":"https://avatars.githubusercontent.com/u/107611?v=3","gravatar_id":"","url":"https://api.github.com/users/mattbennett","html_url":"https://github.com/mattbennett","followers_url":"https://api.github.com/users/mattbennett/followers","following_url":"https://api.github.com/users/mattbennett/following{/other_user}","gists_url":"https://api.github.com/users/mattbennett/gists{/gist_id}","starred_url":"https://api.github.com/users/mattbennett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattbennett/subscriptions","organizations_url":"https://api.github.com/users/mattbennett/orgs","repos_url":"https://api.github.com/users/mattbennett/repos","events_url":"https://api.github.com/users/mattbennett/events{/privacy}","received_events_url":"https://api.github.com/users/mattbennett/received_events","type":"User","site_admin":false},"repo":{"id":37987077,"name":"nameko","full_name":"mattbennett/nameko","owner":{"login":"mattbennett","id":107611,"avatar_url":"https://avatars.githubusercontent.com/u/107611?v=3","gravatar_id":"","url":"https://api.github.com/users/mattbennett","html_url":"https://github.com/mattbennett","followers_url":"https://api.github.com/users/mattbennett/followers","following_url":"https://api.github.com/users/mattbennett/following{/other_user}","gists_url":"https://api.github.com/users/mattbennett/gists{/gist_id}","starred_url":"https://api.github.com/users/mattbennett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattbennett/subscriptions","organizations_url":"https://api.github.com/users/mattbennett/orgs","repos_url":"https://api.github.com/users/mattbennett/repos","events_url":"https://api.github.com/users/mattbennett/events{/privacy}","received_events_url":"https://api.github.com/users/mattbennett/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mattbennett/nameko","description":"Python framework for building microservices","fork":true,"url":"https://api.github.com/repos/mattbennett/nameko","forks_url":"https://api.github.com/repos/mattbennett/nameko/forks","keys_url":"https://api.github.com/repos/mattbennett/nameko/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mattbennett/nameko/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mattbennett/nameko/teams","hooks_url":"https://api.github.com/repos/mattbennett/nameko/hooks","issue_events_url":"https://api.github.com/repos/mattbennett/nameko/issues/events{/number}","events_url":"https://api.github.com/repos/mattbennett/nameko/events","assignees_url":"https://api.github.com/repos/mattbennett/nameko/assignees{/user}","branches_url":"https://api.github.com/repos/mattbennett/nameko/branches{/branch}","tags_url":"https://api.github.com/repos/mattbennett/nameko/tags","blobs_url":"https://api.github.com/repos/mattbennett/nameko/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mattbennett/nameko/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mattbennett/nameko/git/refs{/sha}","trees_url":"https://api.github.com/repos/mattbennett/nameko/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mattbennett/nameko/statuses/{sha}","languages_url":"https://api.github.com/repos/mattbennett/nameko/languages","stargazers_url":"https://api.github.com/repos/mattbennett/nameko/stargazers","contributors_url":"https://api.github.com/repos/mattbennett/nameko/contributors","subscribers_url":"https://api.github.com/repos/mattbennett/nameko/subscribers","subscription_url":"https://api.github.com/repos/mattbennett/nameko/subscription","commits_url":"https://api.github.com/repos/mattbennett/nameko/commits{/sha}","git_commits_url":"https://api.github.com/repos/mattbennett/nameko/git/commits{/sha}","comments_url":"https://api.github.com/repos/mattbennett/nameko/comments{/number}","issue_comment_url":"https://api.github.com/repos/mattbennett/nameko/issues/comments{/number}","contents_url":"https://api.github.com/repos/mattbennett/nameko/contents/{+path}","compare_url":"https://api.github.com/repos/mattbennett/nameko/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mattbennett/nameko/merges","archive_url":"https://api.github.com/repos/mattbennett/nameko/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mattbennett/nameko/downloads","issues_url":"https://api.github.com/repos/mattbennett/nameko/issues{/number}","pulls_url":"https://api.github.com/repos/mattbennett/nameko/pulls{/number}","milestones_url":"https://api.github.com/repos/mattbennett/nameko/milestones{/number}","notifications_url":"https://api.github.com/repos/mattbennett/nameko/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mattbennett/nameko/labels{/name}","releases_url":"https://api.github.com/repos/mattbennett/nameko/releases{/id}","created_at":"2015-06-24T13:48:02Z","updated_at":"2015-06-24T13:48:03Z","pushed_at":"2015-10-19T16:37:02Z","git_url":"git://github.com/mattbennett/nameko.git","ssh_url":"git@github.com:mattbennett/nameko.git","clone_url":"https://github.com/mattbennett/nameko.git","svn_url":"https://github.com/mattbennett/nameko","homepage":"https://nameko.readthedocs.org","size":2180,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"onefinestay:master","ref":"master","sha":"f5d1f2c5edc0f771475790e4629ccdde9421d87a","user":{"login":"onefinestay","id":634153,"avatar_url":"https://avatars.githubusercontent.com/u/634153?v=3","gravatar_id":"","url":"https://api.github.com/users/onefinestay","html_url":"https://github.com/onefinestay","followers_url":"https://api.github.com/users/onefinestay/followers","following_url":"https://api.github.com/users/onefinestay/following{/other_user}","gists_url":"https://api.github.com/users/onefinestay/gists{/gist_id}","starred_url":"https://api.github.com/users/onefinestay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onefinestay/subscriptions","organizations_url":"https://api.github.com/users/onefinestay/orgs","repos_url":"https://api.github.com/users/onefinestay/repos","events_url":"https://api.github.com/users/onefinestay/events{/privacy}","received_events_url":"https://api.github.com/users/onefinestay/received_events","type":"Organization","site_admin":false},"repo":{"id":8431589,"name":"nameko","full_name":"onefinestay/nameko","owner":{"login":"onefinestay","id":634153,"avatar_url":"https://avatars.githubusercontent.com/u/634153?v=3","gravatar_id":"","url":"https://api.github.com/users/onefinestay","html_url":"https://github.com/onefinestay","followers_url":"https://api.github.com/users/onefinestay/followers","following_url":"https://api.github.com/users/onefinestay/following{/other_user}","gists_url":"https://api.github.com/users/onefinestay/gists{/gist_id}","starred_url":"https://api.github.com/users/onefinestay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onefinestay/subscriptions","organizations_url":"https://api.github.com/users/onefinestay/orgs","repos_url":"https://api.github.com/users/onefinestay/repos","events_url":"https://api.github.com/users/onefinestay/events{/privacy}","received_events_url":"https://api.github.com/users/onefinestay/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/onefinestay/nameko","description":"Python framework for building microservices","fork":false,"url":"https://api.github.com/repos/onefinestay/nameko","forks_url":"https://api.github.com/repos/onefinestay/nameko/forks","keys_url":"https://api.github.com/repos/onefinestay/nameko/keys{/key_id}","collaborators_url":"https://api.github.com/repos/onefinestay/nameko/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/onefinestay/nameko/teams","hooks_url":"https://api.github.com/repos/onefinestay/nameko/hooks","issue_events_url":"https://api.github.com/repos/onefinestay/nameko/issues/events{/number}","events_url":"https://api.github.com/repos/onefinestay/nameko/events","assignees_url":"https://api.github.com/repos/onefinestay/nameko/assignees{/user}","branches_url":"https://api.github.com/repos/onefinestay/nameko/branches{/branch}","tags_url":"https://api.github.com/repos/onefinestay/nameko/tags","blobs_url":"https://api.github.com/repos/onefinestay/nameko/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/onefinestay/nameko/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/onefinestay/nameko/git/refs{/sha}","trees_url":"https://api.github.com/repos/onefinestay/nameko/git/trees{/sha}","statuses_url":"https://api.github.com/repos/onefinestay/nameko/statuses/{sha}","languages_url":"https://api.github.com/repos/onefinestay/nameko/languages","stargazers_url":"https://api.github.com/repos/onefinestay/nameko/stargazers","contributors_url":"https://api.github.com/repos/onefinestay/nameko/contributors","subscribers_url":"https://api.github.com/repos/onefinestay/nameko/subscribers","subscription_url":"https://api.github.com/repos/onefinestay/nameko/subscription","commits_url":"https://api.github.com/repos/onefinestay/nameko/commits{/sha}","git_commits_url":"https://api.github.com/repos/onefinestay/nameko/git/commits{/sha}","comments_url":"https://api.github.com/repos/onefinestay/nameko/comments{/number}","issue_comment_url":"https://api.github.com/repos/onefinestay/nameko/issues/comments{/number}","contents_url":"https://api.github.com/repos/onefinestay/nameko/contents/{+path}","compare_url":"https://api.github.com/repos/onefinestay/nameko/compare/{base}...{head}","merges_url":"https://api.github.com/repos/onefinestay/nameko/merges","archive_url":"https://api.github.com/repos/onefinestay/nameko/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/onefinestay/nameko/downloads","issues_url":"https://api.github.com/repos/onefinestay/nameko/issues{/number}","pulls_url":"https://api.github.com/repos/onefinestay/nameko/pulls{/number}","milestones_url":"https://api.github.com/repos/onefinestay/nameko/milestones{/number}","notifications_url":"https://api.github.com/repos/onefinestay/nameko/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/onefinestay/nameko/labels{/name}","releases_url":"https://api.github.com/repos/onefinestay/nameko/releases{/id}","created_at":"2013-02-26T11:59:08Z","updated_at":"2015-10-19T13:52:12Z","pushed_at":"2015-10-19T16:40:30Z","git_url":"git://github.com/onefinestay/nameko.git","ssh_url":"git@github.com:onefinestay/nameko.git","clone_url":"https://github.com/onefinestay/nameko.git","svn_url":"https://github.com/onefinestay/nameko","homepage":"https://nameko.readthedocs.org","size":5388,"stargazers_count":603,"watchers_count":603,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":41,"mirror_url":null,"open_issues_count":22,"forks":41,"open_issues":22,"watchers":603,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/onefinestay/nameko/pulls/288"},"html":{"href":"https://github.com/onefinestay/nameko/pull/288"},"issue":{"href":"https://api.github.com/repos/onefinestay/nameko/issues/288"},"comments":{"href":"https://api.github.com/repos/onefinestay/nameko/issues/288/comments"},"review_comments":{"href":"https://api.github.com/repos/onefinestay/nameko/pulls/288/comments"},"review_comment":{"href":"https://api.github.com/repos/onefinestay/nameko/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/onefinestay/nameko/pulls/288/commits"},"statuses":{"href":"https://api.github.com/repos/onefinestay/nameko/statuses/f15822e7c669a8424debe9c457e3409102e8992d"}}}}