summaryrefslogtreecommitdiff
path: root/tests/pyscript
Commit message (Collapse)AuthorAgeFilesLines
* Added info on semantic versioning and branching strategy to CONTRIBUTING.mdTodd Leonhardt2020-04-241-0/+1
| | | | | | | Also: - Added isort to Pipenv dev - Added setup.cfg to make it easy to run flake8, doc8, and isort directly from the command line without using invoke - Ran isort to sort includes
* Made some optional arguments with defaults keyword-only.Kevin Van Brunt2020-04-111-0/+9
| | | | | Added unit test for echo argument to pyscript app() command. Removed _relative_load from hidden commands since that command was renamed.
* Fixed bug where pyscripts could edit cmd2.Cmd.py_locals dictionary.Kevin Van Brunt2020-02-144-8/+21
| | | | | | | | | Fixed bug where cmd2 set sys.path[0] for a pyscript to its cwd instead of the script's directory. Fixed bug where sys.path was not being restored after a pyscript ran. Setting the following pyscript variables: __name__: __main__ __file__: script path (as typed) Removed do_py.run() function since it didn't handle arguments and offered no benefit over run_pyscript.
* Fixed issue where run_pyscript failed if the script's filename had a spaceKevin Van Brunt2019-07-234-0/+25
|
* Renamed PyscriptBridge to PyBridgeKevin Van Brunt2019-07-201-1/+1
|
* Added unit testKevin Van Brunt2019-06-101-0/+9
|
* Updated commentKevin Van Brunt2019-04-241-2/+8
|
* Added unit test for stdout capture in pyscriptKevin Van Brunt2019-04-231-0/+20
|
* Fixed a lot of warningsKevin Van Brunt2019-03-011-0/+3
|
* Removed ability to call commands as if they were functions in pyscript (e.g. ↵Kevin Van Brunt2019-02-2819-60/+1
| | | | app.help())
* Fix flake8 issuesTodd Leonhardt2018-12-0619-0/+19
| | | | | | | | | | | | | | | | | | | | | | This commit contains a very large number of trivial changes in order to fix flake8 errors and warnings. Predominantly these are whitespace changes. Additionally, the build for Python 3.7 on TravisCI has been tweaked to fail if there are any flake8 errors using the following commandline: * flake8 . --count --ignore=E252 --max-complexity=31 --max-line-length=127 --show-source --statistics NOTE: In the future the max cyclomatic complexity should be lowered, but some improvements need to be made first. One flake8 error is being ignored entirely: * E252 missing whitespace around parameter equals * ignored because it doesn't correctly deal with default argument values after a type hint A few flake8 errors are being selectively ignored in certain files: * C901 fuction is too complex * ignored in argparse_completer.py because the complex code is an override of argparse complexity * E302 expected 2 blank lines after ... * ignored in all unit test files for convenience * F401 module imported but unused * ignored in cmd2/__init__.py because imports are for convenience of cmd2 developers and backwards compatibility * F821 undefined name * ignored in cmd2 script files which are intended to run only within cmd2 applications via pyscript where "app" and "cmd" are defined
* Suppresses stdout and stderr output by default when calling an application ↵Eric Lin2018-05-1719-4/+28
| | | | | | | command from pyscript. Added support for tab completing application commands in ipython shell Updated unit tests scripts to set cmd_echo to True to validate command output.
* Added support for customizing the pyscript bridge pystate object name.Eric Lin2018-05-021-0/+8
| | | | | | | Removed all legacy pystate objects. Changed default behavior to clear _last_result before each command Added utility for creating named tuples with default values Added tests to exercise new changes.
* Added support for different argument modes and tests to validate.Eric Lin2018-05-014-0/+4
|
* Further customization of argparse applying patch submitted to ↵Eric Lin2018-04-301-0/+1
| | | | | | | https://bugs.python.org/issue15112 Added additional tests - now at 100% coverage of pyscript_bridge.py Still need handling of special action types: StoreTrue/False, store_const, count
* Added more tests exercising the pyscript bridge.Eric Lin2018-04-305-1/+5
|
* Added support for translating function positional and keyword arguments into ↵Eric Lin2018-04-286-0/+6
argparse command positional and flag arguments. Added initial set of tests