Title: error running unittest · Issue #17 · ipython/rlipython · GitHub
Open Graph Title: error running unittest · Issue #17 · ipython/rlipython
X Title: error running unittest · Issue #17 · ipython/rlipython
Description: Running tests using unittest from the standard library gives an error about unrecognized arguments. I know this is supposed to be an unmaintained module, but I wonder if IPython already has a standard way of hiding ipython specific args....
Open Graph Description: Running tests using unittest from the standard library gives an error about unrecognized arguments. I know this is supposed to be an unmaintained module, but I wonder if IPython already has a stand...
X Description: Running tests using unittest from the standard library gives an error about unrecognized arguments. I know this is supposed to be an unmaintained module, but I wonder if IPython already has a stand...
Opengraph URL: https://github.com/ipython/rlipython/issues/17
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"error running unittest","articleBody":"Running tests using `unittest` from the standard library gives an error about unrecognized arguments. I know this is supposed to be an unmaintained module, but I wonder if IPython already has a standard way of hiding ipython specific args.\r\n\r\nMaybe a little unusual to actually want to run unittest inside a repl, but the standard repl handles this without error.\r\n\r\nA minimal testcase shows the issue:\r\n\r\n```\r\n$ ipython --TerminalIPythonApp.interactive_shell_class=rlipython.TerminalInteractiveShell\r\nPython 3.6.1 (default, Apr 4 2017, 09:40:51)\r\nType 'copyright', 'credits' or 'license' for more information\r\nIPython 6.0.0 -- An enhanced Interactive Python. Type '?' for help.\r\n\r\nIn [1]: import unittest\r\n\r\nIn [2]: class IpythonTest(unittest.TestCase):\r\n ...: def test_test(self):\r\n ...: self.assertTrue(True)\r\n ...:\r\n\r\nIn [3]: unittest.main()\r\nusage: ipython [-h] [-v] [-q] [--locals] [-f] [-c] [-b] [tests [tests ...]]\r\nipython: error: unrecognized arguments: --TerminalIPythonApp.interactive_shell_class=rlipython.TerminalInteractiveShell\r\nAn exception has occurred, use %tb to see the full traceback.\r\n\r\nSystemExit: 2\r\n\r\n/usr/local/lib/python3.6/site-packages/IPython/core/interactiveshell.py:2855: UserWarning: To exit: use 'exit', 'quit', or Ctrl-D.\r\n warn(\"To exit: use 'exit', 'quit', or Ctrl-D.\", stacklevel=1)\r\n\r\nIn [4]: %tb\r\n---------------------------------------------------------------------------\r\nSystemExit Traceback (most recent call last)\r\n\u003cipython-input-3-7d361a096586\u003e in \u003cmodule\u003e()\r\n----\u003e 1 unittest.main()\r\n\r\n/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/unittest/main.py in __init__(\r\nself, module, defaultTest, argv, testRunner, testLoader, exit, verbosity, failfast, catchbreak, buffer, warnings, tb\r\n_locals)\r\n 91 self.testLoader = testLoader\r\n 92 self.progName = os.path.basename(argv[0])\r\n---\u003e 93 self.parseArgs(argv)\r\n 94 self.runTests()\r\n 95\r\n\r\n/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/unittest/main.py in parseArg$\r\n(self, argv)\r\n 124 return\r\n 125 else:\r\n--\u003e 126 self._main_parser.parse_args(argv[1:], self)\r\n 127\r\n 128 if self.tests:\r\n\r\n/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/argparse.py in parse_args(se$\r\nf, args, namespace)\r\n 1731 if argv:\r\n 1732 msg = _('unrecognized arguments: %s')\r\n-\u003e 1733 self.error(msg % ' '.join(argv))\r\n 1734 return args\r\n 1735\r\n\r\n/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/argparse.py in error(self, m$\r\nssage)\r\n 2387 self.print_usage(_sys.stderr)\r\n 2388 args = {'prog': self.prog, 'message': message}\r\n-\u003e 2389 self.exit(2, _('%(prog)s: error: %(message)s\\n') % args)\r\n\r\n/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/argparse.py in exit(self, st$\r\ntus, message)\r\n 2374 if message:\r\n 2375 self._print_message(message, _sys.stderr)\r\n-\u003e 2376 _sys.exit(status)\r\n 2377\r\n 2378 def error(self, message):\r\n\r\nSystemExit: 2\r\n```\r\n\r\n\r\n\r\n\r\nFor reference, on vanilla IPython, the tests actually run but some noise complains at the end too:\r\n\r\n```\r\n$ ipython\r\nPython 3.6.1 (default, Apr 4 2017, 09:40:51)\r\nType 'copyright', 'credits' or 'license' for more information\r\nIPython 6.0.0 -- An enhanced Interactive Python. Type '?' for help.\r\n\r\nIn [1]: import unittest\r\n\r\nIn [2]: class IpythonTest(unittest.TestCase):\r\n ...: def test_test(self):\r\n ...: self.assertTrue(True)\r\n ...:\r\n\r\nIn [3]: unittest.main()\r\n.\r\n----------------------------------------------------------------------\r\nRan 1 test in 0.000s\r\n\r\nOK\r\nAn exception has occurred, use %tb to see the full traceback.\r\n\r\nSystemExit: False\r\n\r\n/usr/local/lib/python3.6/site-packages/IPython/core/interactiveshell.py:2855: UserWarning: To exit: use 'exit', 'quit', or Ctrl-D.\r\n warn(\"To exit: use 'exit', 'quit', or Ctrl-D.\", stacklevel=1)\r\n```","author":{"url":"https://github.com/yamad","@type":"Person","name":"yamad"},"datePublished":"2017-05-25T17:31:51.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/17/rlipython/issues/17"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:3681791b-abf2-b73f-49da-bbb117e6a086 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9922:2B9D1B:54D9C:73973:6A4D25FB |
| html-safe-nonce | f2809656d95dcbd271cdde514a6f0810f16041d90d17f5d40875b3278accf954 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OTIyOjJCOUQxQjo1NEQ5Qzo3Mzk3Mzo2QTREMjVGQiIsInZpc2l0b3JfaWQiOiI0ODgyMDY2MzM2MTg2NzA1NDAzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | fe17b6724b609e298db019cd516918dd15bd7facb8a743829f2173f863254226 |
| hovercard-subject-tag | issue:231405802 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/ipython/rlipython/17/issue_layout |
| twitter:image | https://opengraph.githubassets.com/fbc835aeac83efbdf84aa1744c59c0503b8f710a3eba617e23752a549d42b123/ipython/rlipython/issues/17 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/fbc835aeac83efbdf84aa1744c59c0503b8f710a3eba617e23752a549d42b123/ipython/rlipython/issues/17 |
| og:image:alt | Running tests using unittest from the standard library gives an error about unrecognized arguments. I know this is supposed to be an unmaintained module, but I wonder if IPython already has a stand... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | yamad |
| hostname | github.com |
| expected-hostname | github.com |
| None | 92571a8944142227b7e19cd10918b1ddd06e5066c1ad5bc7e4769cf6140a87e6 |
| turbo-cache-control | no-preview |
| go-import | github.com/ipython/rlipython git https://github.com/ipython/rlipython.git |
| octolytics-dimension-user_id | 230453 |
| octolytics-dimension-user_login | ipython |
| octolytics-dimension-repository_id | 83718292 |
| octolytics-dimension-repository_nwo | ipython/rlipython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 83718292 |
| octolytics-dimension-repository_network_root_nwo | ipython/rlipython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 93f17a978ee60bc4668e1d7b90e6bd2d622261fd |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width