{"action":"created","issue":{"url":"https://api.github.com/repos/django-nose/django-nose/issues/142","labels_url":"https://api.github.com/repos/django-nose/django-nose/issues/142/labels{/name}","comments_url":"https://api.github.com/repos/django-nose/django-nose/issues/142/comments","events_url":"https://api.github.com/repos/django-nose/django-nose/issues/142/events","html_url":"https://github.com/django-nose/django-nose/issues/142","id":20405876,"number":142,"title":"selecting tests by attributes does not seem to work","user":{"login":"shalonwood","id":3503034,"avatar_url":"https://avatars.githubusercontent.com/u/3503034?v=3","gravatar_id":"","url":"https://api.github.com/users/shalonwood","html_url":"https://github.com/shalonwood","followers_url":"https://api.github.com/users/shalonwood/followers","following_url":"https://api.github.com/users/shalonwood/following{/other_user}","gists_url":"https://api.github.com/users/shalonwood/gists{/gist_id}","starred_url":"https://api.github.com/users/shalonwood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shalonwood/subscriptions","organizations_url":"https://api.github.com/users/shalonwood/orgs","repos_url":"https://api.github.com/users/shalonwood/repos","events_url":"https://api.github.com/users/shalonwood/events{/privacy}","received_events_url":"https://api.github.com/users/shalonwood/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/django-nose/django-nose/labels/bug","name":"bug","color":"e11d21"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/django-nose/django-nose/milestones/8","html_url":"https://github.com/django-nose/django-nose/milestones/v1.4.3","labels_url":"https://api.github.com/repos/django-nose/django-nose/milestones/8/labels","id":1342805,"number":8,"title":"v1.4.3","description":"Goals:\r\n* Handle Django-style arguments with options (``--verbosity 2`` rather than ``--verbosity=2``)\r\n* More REUSE_DB=1 fixes\r\n","creator":{"login":"jwhitlock","id":286017,"avatar_url":"https://avatars.githubusercontent.com/u/286017?v=3","gravatar_id":"","url":"https://api.github.com/users/jwhitlock","html_url":"https://github.com/jwhitlock","followers_url":"https://api.github.com/users/jwhitlock/followers","following_url":"https://api.github.com/users/jwhitlock/following{/other_user}","gists_url":"https://api.github.com/users/jwhitlock/gists{/gist_id}","starred_url":"https://api.github.com/users/jwhitlock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwhitlock/subscriptions","organizations_url":"https://api.github.com/users/jwhitlock/orgs","repos_url":"https://api.github.com/users/jwhitlock/repos","events_url":"https://api.github.com/users/jwhitlock/events{/privacy}","received_events_url":"https://api.github.com/users/jwhitlock/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":0,"state":"open","created_at":"2015-10-07T14:19:18Z","updated_at":"2015-10-07T14:25:41Z","due_on":"2015-11-17T06:00:00Z","closed_at":null},"comments":8,"created_at":"2013-10-02T16:30:58Z","updated_at":"2015-10-07T14:38:19Z","closed_at":null,"body":"If I specify an attribute via -a or --attr, no tests are run. \r\n\r\nIf I set NOSE_ATTR, it seems to work, but I can't specify multiple attributes to limit the tests to ones which have all attributes. E.g., NOSE_ATTR='scope=local,hostname' seems to run all tests which have _either_ a scope attribute of local, or a hostname attribute, not both. It's possible I'm not setting NOSE_ATTR correctly, however, as I've never needed to use it before.\r\n\r\nWe're using django-nose 1.2, nose 1.3, and python 2.6. In our non-django projects, we're able to limit tests this way without issue.\r\n\r\nExpected outcome:\r\nTests can be selected using attributes as per the documentation."},"comment":{"url":"https://api.github.com/repos/django-nose/django-nose/issues/comments/146214535","html_url":"https://github.com/django-nose/django-nose/issues/142#issuecomment-146214535","issue_url":"https://api.github.com/repos/django-nose/django-nose/issues/142","id":146214535,"user":{"login":"jwhitlock","id":286017,"avatar_url":"https://avatars.githubusercontent.com/u/286017?v=3","gravatar_id":"","url":"https://api.github.com/users/jwhitlock","html_url":"https://github.com/jwhitlock","followers_url":"https://api.github.com/users/jwhitlock/followers","following_url":"https://api.github.com/users/jwhitlock/following{/other_user}","gists_url":"https://api.github.com/users/jwhitlock/gists{/gist_id}","starred_url":"https://api.github.com/users/jwhitlock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwhitlock/subscriptions","organizations_url":"https://api.github.com/users/jwhitlock/orgs","repos_url":"https://api.github.com/users/jwhitlock/repos","events_url":"https://api.github.com/users/jwhitlock/events{/privacy}","received_events_url":"https://api.github.com/users/jwhitlock/received_events","type":"User","site_admin":false},"created_at":"2015-10-07T14:38:19Z","updated_at":"2015-10-07T14:38:19Z","body":"I started to dive into this, and the fix will be longer than expected, so bumping to v1.4.3.\r\n\r\nShort version: using ``--option value`` probably won't work (yet), but ``--option=value`` might.\r\n\r\nLonger version:\r\n\r\nCommand line parsing is complicated:\r\n\r\n1. django-nose merges nose parse options with Django parse options.  There is a different strategy for Django 1.6 and earlier (using ``optparse``) from Django 1.7 and later (using ``argparse``).\r\n2. Django's management command framework parses the command line\r\n3. Django's test command class interprets some, but not all, of the command line options\r\n4. django-nose reformats the command-line arguments to modify Django-specific options\r\n5. nose's command line parser re-parses the reformatted command-line arguments\r\n\r\nThe problem is that Django likes ``--option value`` (and this is what ``./manage.py test --help`` will show), but nose likes ``--option=value``.  We're already manipulating the command-line args in step 4, to make things like ``verbosity`` work,  but something more generic is needed for other options with values.  Ideally, we could pass the results of Django's command line parsing to nose and skip the re-parsing steps (4 and 5), but I'm not sure if nose has the right hooks, and it may cause other issues."}}