We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5fce40b commit c17858dCopy full SHA for c17858d
tests/test_cmd2.py
@@ -38,6 +38,15 @@ def outsim_app():
38
def test_version(base_app):
39
assert cmd2.__version__
40
41
+def test_not_in_main_thread(base_app, capsys):
42
+ import threading
43
+ cli_thread = threading.Thread(name='cli_thread', target=base_app.cmdloop)
44
+
45
+ cli_thread.start()
46
+ cli_thread.join()
47
+ out, err = capsys.readouterr()
48
+ assert "cmdloop must be run in the main thread" in err
49
50
def test_empty_statement(base_app):
51
out, err = run_cmd(base_app, '')
52
expected = normalize('')
0 commit comments