xonsh/tests
Peter Ye 259fbe540c
fix: do not append empty/comment-only input to history (#4822)
* add test for importing empty .xsh file

* test: empty lines do not get appended to history

prompt-toolkit needs its own test outside of test_base_shell.py because it uses a custom _push() method

* fix: do not append empty/comment-only input to history

Adds a compile_empty_tree argument to Execer.compile()
By default, the argument is `True`, and `compile()` returns a compiled `pass` statement for comment-only input.
When the argument is `False`, `compile()` returns `None` for comment-only input.

The base shell and prompt-toolkit shell use `compile_empty_tree = False` so that they get `None` as the compiled code and don't append the command to the history.

* add news

* fix tests
2022-05-26 17:50:08 +05:30
..
aliases test: update tests 2022-03-24 19:49:30 +05:30
bin style: isort imports 2022-01-31 11:16:51 -05:00
completers Fix environment variable completion in strings (#4804) 2022-05-21 10:54:36 +05:30
histories Fix tests 2020-09-23 21:15:37 +02:00
man1 improve completers (#4648) 2022-01-27 21:22:36 +05:30
procs style: sort imports 2022-03-24 19:49:30 +05:30
prompt fix: gitstatus prompt (#4772) 2022-04-23 07:01:04 +05:30
scripts xonsh script.xsh should not fail over 2017-01-11 21:59:42 +08:00
test_lib chore: update tests 2022-03-24 19:49:30 +05:30
xontribs feat: filter completions from fish (#4765) 2022-05-22 22:44:36 +05:30
xoreutils Add uname command, Update uptime comand (#3909) 2022-01-08 18:28:46 +05:30
xpack fix: do not append empty/comment-only input to history (#4822) 2022-05-26 17:50:08 +05:30
.somedotfile dotfile matching 2018-09-12 18:12:02 -04:00
bashrc.sh added tests for foreign shells 2015-10-10 19:52:53 -04:00
batch.bat Add test for sourcing bat file on windows 2016-04-18 00:41:11 +02:00
conftest.py Fix vox env dir (#4736) 2022-03-27 17:12:52 +05:30
run_pwd.xsh more fixes 2016-09-09 00:58:32 -04:00
sample.xsh fixed up dashing 2018-11-08 13:16:44 -05:00
test_aliases.py Fix vox env dir (#4736) 2022-03-27 17:12:52 +05:30
test_ansi_colors.py style: isort imports 2022-01-31 11:16:51 -05:00
test_ast.py style: sort imports 2022-03-24 19:49:30 +05:30
test_base_shell.py fix: do not append empty/comment-only input to history (#4822) 2022-05-26 17:50:08 +05:30
test_bashisms.py style: isort imports 2022-01-31 11:16:51 -05:00
test_builtins.py style: sort imports 2022-03-24 19:49:30 +05:30
test_cli_utils.py history transfer (#4604) 2021-12-20 08:36:29 +05:30
test_color_tools.py Fix tests 2020-09-23 21:15:37 +02:00
test_commands_cache.py style: sort imports 2022-03-24 19:49:30 +05:30
test_completer.py style: isort imports 2022-01-31 11:16:51 -05:00
test_completion_context.py style: sort imports 2022-03-24 19:49:30 +05:30
test_contexts.py style: isort imports 2022-01-31 11:16:51 -05:00
test_dirstack.py style: isort imports 2022-01-31 11:16:51 -05:00
test_dirstack_unc.py test: python completers have become flaky 2022-03-22 19:13:11 +05:30
test_environ.py style: sort imports 2022-03-24 19:49:30 +05:30
test_events.py style: isort imports 2022-01-31 11:16:51 -05:00
test_execer.py chore: update tests 2022-03-24 19:49:30 +05:30
test_foreign_shells.py style: sort imports 2022-03-24 19:49:30 +05:30
test_history_dummy.py history transfer (#4604) 2021-12-20 08:36:29 +05:30
test_history_json.py style: isort imports 2022-01-31 11:16:51 -05:00
test_history_sqlite.py style: isort imports 2022-01-31 11:16:51 -05:00
test_imphooks.py fix: do not append empty/comment-only input to history (#4822) 2022-05-26 17:50:08 +05:30
test_integrations.py style: sort imports 2022-03-24 19:49:30 +05:30
test_jobs.py style: isort imports 2022-01-31 11:16:51 -05:00
test_jsonutils.py style: isort imports 2022-01-31 11:16:51 -05:00
test_lazyasd.py black tests 2018-08-30 09:18:49 -05:00
test_lazyjson.py style: isort imports 2022-01-31 11:16:51 -05:00
test_lexer.py style: isort imports 2022-01-31 11:16:51 -05:00
test_main.py style: sort imports 2022-03-24 19:49:30 +05:30
test_man.py style: sort imports 2022-03-24 19:49:30 +05:30
test_news.py style: isort imports 2022-01-31 11:16:51 -05:00
test_parser.py style: sort imports 2022-03-24 19:49:30 +05:30
test_pipelines.py style: sort imports 2022-03-24 19:49:30 +05:30
test_platform.py style: isort imports 2022-01-31 11:16:51 -05:00
test_pretty.py fix: item order of pretty-printed dictionaries (#4786) 2022-04-30 08:25:52 +05:30
test_ptk_completer.py style: isort imports 2022-01-31 11:16:51 -05:00
test_ptk_highlight.py style: sort imports 2022-03-24 19:49:30 +05:30
test_ptk_history.py refactor: remove xonsh.ptk2 module (#4570) 2021-11-30 08:22:31 -05:00
test_ptk_multiline.py style: isort imports 2022-01-31 11:16:51 -05:00
test_ptk_shell.py fix: do not append empty/comment-only input to history (#4822) 2022-05-26 17:50:08 +05:30
test_pyghooks.py style: isort imports 2022-01-31 11:16:51 -05:00
test_readline_shell.py Add test for readline shell (#4447) 2021-09-02 22:15:20 +03:00
test_shell.py style: isort imports 2022-01-31 11:16:51 -05:00
test_tools.py style: sort imports 2022-03-24 19:49:30 +05:30
test_tracer.py pre-commit hook for pyupgrade (#4583) 2021-12-06 14:42:26 -05:00
test_virtualenv_activator.py We can't be sure there's a python binary (#4802) 2022-05-10 15:55:03 +05:30
test_vox.py Fix vox env dir (#4736) 2022-03-27 17:12:52 +05:30
test_wizard.py style: isort imports 2022-01-31 11:16:51 -05:00
test_xonfig.py test: add back xonfig-info test 2022-03-25 10:41:42 -04:00
test_xonsh.xsh Remove globals (#4280) 2021-05-20 13:14:26 +03:00
test_xontribs.py Rm xontrib meta (#4790) 2022-05-04 15:02:20 -04:00