title: Running script with argument seems to cause RecursionError
body: <p>I'm working on a little project with <code>unittest</code>.</p>
  
  <p>I can run my tests but if I add an argument to my command line entry (e.g : <code>./myprogramm.py test</code> instead of just <code>./myprogramm.py</code>) in order to add an <code>argparse</code> layer (argparse itself doesn't seem to be the cause of the problem) a <code>RecursionError</code> occurs.</p>
  
  <p><strong>Sample file to reproduce :</strong></p>
  
  <pre><code>#!/usr/bin/env python3                                                                                                
  
  import argparse
  import unittest
  
  def foo():
      return True
  
  class FooTestCase(unittest.TestCase):
      def test_foo(self):
          self.assertTrue(foo())
  
  def test():
      unittest.main()
  
  def main():
      foo()
  
  def make_parser():
      parser = argparse.ArgumentParser(description='test or foo.')
      subparsers = parser.add_subparsers(dest='subcommand')
      subparsers.required = True
      subparsers.add_parser('test')
      subparsers.add_parser('foo')
      return parser
  
  if __name__ == '__main__':
      parser = make_parser()
      args = parser.parse_args()
      if args.subcommand == 'test':
          test()
      elif args.subcommand == 'foo':
          main()
  </code></pre>
  
  <p>Launching this programm with <code>./myprogramm.py foo</code> works, but not if I launch it with <code>./myprogramm.py test</code>.</p>
  
  <p><strong>Output with <code>RecursionError</code> :</strong></p>
  
  <pre><code>  File "./myprogramm.py", line 14, in test
      unittest.main()
    File "/usr/lib/python3.5/unittest/main.py", line 93, in __init__
      self.parseArgs(argv)
    File "/usr/lib/python3.5/unittest/main.py", line 140, in parseArgs
      self.createTests()
    File "/usr/lib/python3.5/unittest/main.py", line 147, in createTests
      self.module)
    File "/usr/lib/python3.5/unittest/loader.py", line 219, in loadTestsFromNames
      suites = [self.loadTestsFromName(name, module) for name in names]
    File "/usr/lib/python3.5/unittest/loader.py", line 219, in &lt;listcomp&gt;
      suites = [self.loadTestsFromName(name, module) for name in names]
    File "/usr/lib/python3.5/unittest/loader.py", line 204, in loadTestsFromName
      test = obj()
    File "./myprogramm.py", line 14, in test
      unittest.main()
    File "/usr/lib/python3.5/unittest/main.py", line 93, in __init__
      self.parseArgs(argv)
    File "/usr/lib/python3.5/unittest/main.py", line 114, in parseArgs
      self._initArgParsers()
    File "/usr/lib/python3.5/unittest/main.py", line 150, in _initArgParsers
      parent_parser = self._getParentArgParser()
    File "/usr/lib/python3.5/unittest/main.py", line 155, in _getParentArgParser
      parser = argparse.ArgumentParser(add_help=False)
    File "/usr/lib/python3.5/argparse.py", line 1629, in __init__
      self._positionals = add_group(_('positional arguments'))
    File "/usr/lib/python3.5/gettext.py", line 514, in gettext
      return dgettext(_current_domain, message)
    File "/usr/lib/python3.5/gettext.py", line 478, in dgettext
      codeset=_localecodesets.get(domain))
    File "/usr/lib/python3.5/gettext.py", line 413, in translation
      mofiles = find(domain, localedir, languages, all=True)
    File "/usr/lib/python3.5/gettext.py", line 376, in find
      val = os.environ.get(envar)
    File "/usr/lib/python3.5/_collections_abc.py", line 595, in get
      return self[key]
  RecursionError: maximum recursion depth exceeded
  </code></pre>
  
  <p><strong>How could I (should I?) handle this?</strong></p>
  
  <p>Thus far to avoid this problem, I run <code>del sys.argv[1]</code>. But is there a better way?</p>
  
  <p>I guess that <code>unittest.main()</code> uses <code>sys.argv</code> and <code>test</code> as first argument triggers a particular behaviour for this function.</p>
  
  <p>If I use an other keyword that <code>test</code> I get something like this (using <code>bar</code> here) :</p>
  
  <pre><code>E
  ======================================================================
  ERROR: bar (unittest.loader._FailedTest)
  ----------------------------------------------------------------------
  AttributeError: module '__main__' has no attribute 'bar'
  
  ----------------------------------------------------------------------
  Ran 1 test in 0.000s
  
  FAILED (errors=1)
  </code></pre>