diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-03-27 21:57:40 -0400 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-03-27 21:57:40 -0400 |
commit | c17858d3ad13b830d8e579f13b80d736877c0ba8 (patch) | |
tree | fb964f193ee0b7deb2d31cc43ff4b770a6d1455c /tests/test_cmd2.py | |
parent | 5fce40b75c9fdd5c3a2af47a43bfcd873f9c3804 (diff) | |
download | cmd2-git-c17858d3ad13b830d8e579f13b80d736877c0ba8.tar.gz |
Added unit test
Diffstat (limited to 'tests/test_cmd2.py')
-rw-r--r-- | tests/test_cmd2.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py index e7416105..d33477f2 100644 --- a/tests/test_cmd2.py +++ b/tests/test_cmd2.py @@ -38,6 +38,15 @@ def outsim_app(): def test_version(base_app): assert cmd2.__version__ +def test_not_in_main_thread(base_app, capsys): + import threading + cli_thread = threading.Thread(name='cli_thread', target=base_app.cmdloop) + + cli_thread.start() + cli_thread.join() + out, err = capsys.readouterr() + assert "cmdloop must be run in the main thread" in err + def test_empty_statement(base_app): out, err = run_cmd(base_app, '') expected = normalize('') |