<jupyter_start><jupyter_text>Example of how to use unittest in IPython or JupyterConfiguration for runnint unittest in IPython or Jupyter is different than running unittest from command line. When you run following code from IPython or Jupyter```pythonif __name__ == '__main__':    unittest.main()```will result in following error:```E======================================================================ERROR: C:\Users\XXXX\AppData\Roaming\jupyter\runtime\kernel-4b12e789-a050-4567-a8a1-7361d4a1745f (unittest.loader._FailedTest)----------------------------------------------------------------------AttributeError: module '__main__' has no attribute 'C:\Users\XXXX\AppData\Roaming\jupyter\runtime\kernel-4b12e789-a050-4567-a8a1-7361d4a1745f'----------------------------------------------------------------------Ran 1 test in 0.001sFAILED (errors=1)An exception has occurred, use %tb to see the full traceback.SystemExit: Trued:\development\lib\site-packages\IPython\core\interactiveshell.py:2855: UserWarning: To exit: use 'exit', 'quit', or Ctrl-D.  warn("To exit: use 'exit', 'quit', or Ctrl-D.", stacklevel=1)```The reason is that `unittest.main` looks at `sys.argv` and first parameter is what started IPython or Jupyter, therefore the error about kernel connection file not being a valid attribute.Passing explicit list to `unittest.main` will prevent IPython and Jupyter look at `sys.argv`.Passing `exit=Fals` will prevent `unittest.main` to shutdown the kernell process```pythonif __name__ == '__main__':    unittest.main(argv=['first-arg-is-ignored'], exit=False)```<jupyter_code>if __name__ == '__main__':
    unittest.main()
if __name__ == '__main__':
    unittest.main(argv=['first-arg-is-ignored'], exit=False)
class TestDemo1(unittest.TestCase):
    """Example of how to use unittest in Jupyter."""
    
    def test1(self):
        self.assertEqual('foo'.upper(), 'FOO')   
if __name__ == '__main__':
    unittest.main(argv=['first-arg-is-ignored'], exit=False)<jupyter_output>..
----------------------------------------------------------------------
Ran 2 tests in 0.001s

OK<jupyter_text>or directly call unittest.main()<jupyter_code>unittest.main(argv=[''], verbosity=2, exit=False)<jupyter_output>test (__main__.TestDemo) ... ok
test1 (__main__.TestDemo1) ... ok

----------------------------------------------------------------------
Ran 2 tests in 0.002s

OK
{'fraction_non_alphanumeric': 0.25672268907563023, 'fraction_numerical': 0.031092436974789917, 'mean_word_length': 2.9816053511705687, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '504326', 'license': 'Apache-2.0', 'n_tokens_mistral': 763, 'n_tokens_neox': 706, 'n_words': 183, 'path': 'unit1/test.try.ipynb', 'repo_name': 'vchub/nik_notebooks', 'size': '2380'}