Commit graph

18 commits

Author SHA1 Message Date
Andy Kipp
ec378090ce
Using repr(cmd) for command not found (#5075)
repr cmd

Co-authored-by: a <1@1.1>
2023-03-02 11:13:36 +05:30
pre-commit-ci[bot]
ba8ae973b8 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/psf/black: 22.12.0 → 23.1.0](https://github.com/psf/black/compare/22.12.0...23.1.0)
- [github.com/pycqa/isort: 5.11.4 → 5.12.0](https://github.com/pycqa/isort/compare/5.11.4...5.12.0)
2023-02-14 22:57:36 +05:30
Blake Ramsdell
b0c81048af
feat: add on_command_not_found event (#4959) 2022-10-11 08:54:12 -04:00
Peter Ye
6fa83f8305
Do not capture unthreaded callable aliases run with ![] (#4919)
* Fix `cd` command error message when `$THREAD_SUBPROCS=False`

* also test $[]
2022-08-11 22:50:21 +05:30
Peter Ye
be604e7f48
Change ![] to return an object for background command (#4823)
* Change ![] to return an object for background command

* Fix `fg` for commands started in the background

Fixes #4595

This issue was caused by `CommandPipeline.term_pgid` not being set for commands started in the background.
2022-06-05 21:10:21 +05:30
Noortheen Raja
f2b7d4ed4f style: sort imports 2022-03-24 19:49:30 +05:30
Noortheen Raja
81b65556a5 chore: update tests 2022-03-24 19:49:30 +05:30
Noortheen Raja
78091a22f3 style: isort imports
fix #4584
2022-01-31 11:16:51 -05:00
Noorhteen Raja NJ
7c4e207abd
update test xsh usage (#4581)
* todo

* test: remove usage of DummyEnv and setting .env attribute on xession fixture

one step closer to making too much of tweaking to xession during tests

* test: fix tests vox and gitstatus-prompt

* docs: update test-fixture usage

* fix: import flake8 error

* test: remove direct access to XSH in tests

* test: remove usage of XSH in test files

* todo

* test: use tmp-dir to create stubs

* refactor: use fixture factory to mock out XonshSession

* refactor: remove direct access of XSH from functions

* refactor: remove direct access of XSH from functions

* fix: qa checks

* refactor: rename variables to match their values

* test: update failing tests because it had no PATH set previously

* fix: remove builtins usage from pyghooks.py

* style:

* refactor: update tests to use fixtures

* fix: env varialbe is setup per function

some tests accidentally update the env variables and that is leaking
into next tests

* fix: failing vox tests

* test: set commands_cache per test

* test: fix failing tests

* fix: failing tests on linux

ptk-highlight

* fix: failing tests on Windows

cwd-prompt

* test: copy env as to not affect original object

* fix: lazily evaluate cmds-cache in pyghooks

* test: fix failing tests

* fix: qa errors import

* test: set commands-cache per test

while caching path results

* test: speedup test_thread_local_swap

* fix: failing tests on windows

* refactor: Execer doesn't control session

* refactor: XSH.unload will take care of reversing builtins attrs set

* test: use env.update over monkeypatch

* Revert "test: use env.update over monkeypatch"

This reverts commit 010a5022247a098f1741966b8af1bf758663480e.
2022-01-07 17:33:22 -05:00
Noorhteen Raja NJ
d51a03bc74
fix: random test failures on macos (#4518) 2021-10-15 08:53:30 -04:00
Noorhteen Raja NJ
1c2be53040
refactor: remove redundant code (#4478) 2021-09-21 16:55:10 -04:00
Daniel Shimon
7ce53f1844
Always capture aliases (#4445)
* specs: Make sure sub-specs are always captured regardless of $XONSH_CAPTURE_ALWAYS

* procs: Ensure env is used in functional aliases

* news: Add always-capture-aliases

* tests: procs: Skip known issues

* tests: Restore all builtins in the 'xonsh_builtins' fixture

* tests: vc: Use monkeypatch to mock CommandsCache functions

* tests: main: Don't use the local machine's xonshrc
2021-09-15 15:14:28 -04:00
Peter Ye
d08006b0e0
Change !() to also capture background subprocesses (#4406)
* Change !() to also capture background subprocesses

* Add test

* Add news

* Simplify logic
2021-08-01 21:58:19 +03:00
Noorhteen Raja NJ
112440ef63
feat: support var-args signature for aliases (#4379)
* feat: support var-args signature for aliases

* test: add test for callable alias
2021-07-25 13:15:05 +03:00
Peter Ye
86f02c0341
Stop $() from silently capturing stderr (#4336)
* Stop $() from silently capturing stderr

* Add test
2021-06-24 09:43:21 -04:00
Daniel Shimon
f87be90d6f
procs: Add $XONSH_CAPTURE_ALWAYS variable for opt-in interactive capt… (#4283)
* procs: Add $XONSH_CAPTURE_ALWAYS variable for opt-in interactive capturing

* tests: Add tests for $XONSH_CAPTURE_ALWAYS

* tests: Fix tests wrt $XONSH_CAPTURE_ALWAYS

* news: Add optional-interractive-capture
2021-06-21 12:36:37 -04:00
Noorhteen Raja NJ
38295a1dd9
Remove globals (#4280)
* refactor: remove usage of global variables in abbrevs.py

* chore: add flake8-mutable to prevent mutable defaults

* fix: abbrevs expand test

* refactor: add xonsh session singleton

* refactor: fix circular errors when using xonshSession as singleton

* refactor: remove black magicked builtin attributes

* style: black format tests as well

* refactor: update tests to use xonsh-session singleton

* refactor: update abbrevs to not use builtins

* test: remove DummyCommandsCache and patch orig class

* fix: failing test_command_completers

* test: use monkeypatch to update xession fixture

* fix: failing test_pipelines

* fix: failing test_main

* chore: run test suit as single invocation

* test: fix tests/test_xonsh.xsh

* refactor: remove builtins from docs/conf.py

* fix: mypy error in jobs

* fix: test error from test_main

* test: close xession error in test_command_completers

* chore: use pytest-cov for reporting coverage

this will include subprocess calls, and will increase coverage

* style:
2021-05-20 13:14:26 +03:00
Anthony Scopatz
3afd5430a0
Procs Initial Refactor (#3897)
* refectored builtins

* refectored posix and readers

* refectored posix and readers

* proxies

* pipelines

* basic procs import cleanup

* fixed / refactored tests

* procs docs

* amalgamate

* XONSH_DEBUG=1 in tests

* exclude xonsh.procs mypy

* Use `pip install` instead of `python setup.py install`

* Update docs/api/procs/pipelines.rst

Co-authored-by: Gil Forsyth <gforsyth@users.noreply.github.com>

Co-authored-by: Gil Forsyth <gil@forsyth.dev>
Co-authored-by: Gil Forsyth <gforsyth@users.noreply.github.com>
2020-10-20 10:21:11 -04:00