summaryrefslogtreecommitdiffstats
path: root/tests/features
AgeCommit message (Collapse)Author
2023-10-18confirm_destructive_query: Use confirm rather than prompt (#1410)Sharon Yogev
* confirm_destructive_query: Use confirm rather than prompt * Fix tests
2023-10-11Drop python 3.7, add 3.12 (#1426)Irina Truong
* Fix deprecation. * Drop python 3.7 and add 3.12. * Bump pendulum. * Changelog. * Update gh actions. * See if things pass without this scenario. * Skip failing scenarios in 3.12.
2023-09-26Ask for confirmation to quit cli if a transaction is ongoing. (#1400)Damien Baty
If user tries to quit the cli while a transaction is ongoing (i.e. begun, but not committed or rolled back yet), pgcli now asks for a confirmation. The user can choose to commit, rollback or cancel the exit. If the user chooses to commit or rollback, we exit only if the commit/rollback succeeds. Fixes #1071.
2023-03-18Remove leftovers of Python 2 supportDamien Baty
2022-11-17Add config option to not automatically restart connection on destructive ↵Andy Schoenberger
warning abort; defaults to not restarting. (#1379)
2022-06-08Fix typos (#1345)Kian-Meng Ang
Co-authored-by: Irina Truong <i.chernyavska@gmail.com>
2022-06-06Port to psycopg3 (#1324)Irina Truong
* WIP. * Add some comments about porting from psycopg 2 to 3 (#1318) * WIP * Disable _set_wait_callback() * TransactionStatus. * First working query. * More pg3 changes. * test_pgexecute still fails. * Fix bytea support. * Fix json and enum unicode. * Get unit tests to pass. * Behave tests still break, WIP. * Prompt seems to be displayed fine, why don't the tests see the whitespace? * Python version. * Fix test. * Black. * Added black to dev reqs. * nbu link for donations. * Use psycopg.sql to format statement. * Special case for show help in pgbouncer. * Fix test. * Added integration test. * Install pgbouncer in ci. * Fix integration test. * Remove tmate session. * Revert commenting out python versions. * Pin pgspecial to >=2. * Changelog. Co-authored-by: Daniele Varrazzo <daniele.varrazzo@gmail.com> Co-authored-by: Amjith Ramanujam <amjith.r@gmail.com>
2022-02-18Add SSH tunnel support (#1301)Bruno Inec
* Add initial sshtunnel support * Force CI to rerun. * Fix unit test for 3.6. * Black. Co-authored-by: Irina Truong <i.chernyavska@gmail.com>
2021-09-03Add setting in config to control truncating field values. (#1285)Irina Truong
* Add setting in config to truncate field value. * Black. * Changelog. * Fix tests.
2021-05-21Another attempt to fix pgbouncer error (1093.) (#1097)Irina Truong
* Another attempt to fix pgbouncer error (1093.) * Fixes for various pgbouncer problems. * different approach with custom cursor. * Fix rebase. * Missed this. * Fix completion refresher test. * Black. * Unused import. * Changelog. * Fix race condition in test. * Switch from is_pgbouncer to more generic is_virtual_database, and duck-type it. Add very dumb unit test for virtual cursor. * Remove debugger code.
2021-02-22Fix test_config.py on Windows (#1247)ERYoung11
* fixing test_config.py to work on windows * Getting rid of odd characters in wrappager.py * added a space to a comment to try to kick the github workflow. Co-authored-by: Eric Young <YoungEricR@JohnDeere.com>
2021-02-12Finer control over destructive warning. (#1242)Irina Truong
* Finer control over destructive warning. * Review feedback. * Changelog. * Run integration tests with --warn=moderate. * Fix typo. * Black.
2021-02-12Modernize code to Python 3.6+ (#1229)Miroslav Šedivý
1. `class A(object)` can be written as `class A:` 2. replace `dict([…])` and `set([…])` with `{…}` 3. use f-strings or compact `.format` 4. use `yield from` instead of `yield` in a `for` loop 5. import `mock` from `unittest` 6. expect `OSError` instead of `IOError` or `select` error 7. use Python3 defaults for file reading or `super()` 8. remove redundant parenthesis (keep those in tuples though) 9. shorten set intersection instead of creating lists 10. backslashes in strings do not have to be escaped if prepended with `r`
2021-01-18Conditional didn't work in CI. (#1237)Irina Truong
* Conditional didn't work in CI. * Try to fix flaky exit.
2020-10-13test: test pgcli on python3.9 (#1214)laixintao
* test: test pgcli on python3.9 * test on 3.9 * use 3.9-dev version from travis. * try to fix pexpect EOF.
2020-04-05upgrade prompt-toolit to 3.0 (#1149)赖信涛
* upgrade prompt-toolit to 3.0 fix: https://github.com/dbcli/pgcli/issues/1148 related: https://github.com/prompt-toolkit/python-prompt-toolkit/issues/886 in order to make the `behave` test pass, I have to: - extend timeout for database connection test. - extend timeout for basic command expect. - extend timeout for features/steps/crud_table.py:: see data selected. - disable cpr for features but "run the cli" * [ci] disable CPR for all behave tests. * bugfix: remove duplicated prompt expect. * [ci] delete CPR env setting. * Revert "[ci] delete CPR env setting." This reverts commit fe4d5b565e01be6237b6df646429d26eaa0c6d92. * revert the extending timeout back. * [ci] test when didn't disable CPR. * Revert "[ci] test when didn't disable CPR." This reverts commit d379b1e736dcc6623ba53fc3d4e6f095fd3e8344.
2020-03-14removed py2-related stuffGeorgy Frolov
2019-10-29run black againMartin Matějek
2019-10-23Add a test to verify error message.Amjith Ramanujam
2019-05-25black all the things. (#1049)Irina Truong
* added black to develop guide * no need for pep8radius. * changelog. * Add pre-commit checkbox. * Add pre-commit to dev reqs. * Add pyproject.toml for black. * Pre-commit config. * Add black to travis and dev reqs. * Install and run black in travis. * Remove black from dev reqs. * Lower black target version. * Re-format with black.
2019-05-21pep8.Irina Truong
2019-05-21Fix for dsn_password behave test.Irina Truong
2019-05-15Add a behave test with spaces in password.Amjith Ramanujam
2019-05-14Add some behavioral tests for command line options.Amjith Ramanujam
2019-01-22Merge pull request #1001 from dbcli/internal/add_behave_loggingAmjith Ramanujam
Missed logfile for earlier clean up and add behave logging changes
2019-01-22Merge pull request #996 from saper/pexpect_exceptionsDick Marinus
Use pexpect.TIMEOUT instead of pexpect.exceptions.TIMEOUT
2019-01-22fixup! Clean up and add behave logging (#956)Dick Marinus
2019-01-22VISUAL overrides the value of EDITOR for the \e commandMarcin Cieślak
This is an ancient UNIX tradition universally respected.
2019-01-22Use pexpect.TIMEOUT instead of pexpect.exceptions.TIMEOUTMarcin Cieślak
All pexpect submodules have been moved into the pexpect package as of version 3.0.
2018-10-14Clean up and add behave logging (#956)Dick Marinus
2018-10-02Fix for pgcli --list. (#952)Irina Truong
Fix for pgcli --list
2018-09-28Cherry-picked prompt-toolkit 2.0 changes. (#930)Irina Truong
* Cherry-picked prompt-toolkit 2.0 changes. * Increase help timeout. * Missed one. * Fixes editor command. * Expect exact to fix named query error. * Unicode is non-optional with ptk 2.0. * Unicode literals all the things (almost). * PEP8. * Change how we swap completers. * By default, bottom toolbar styles are reversed. We don't want that. * Adapt styles to 2.0. * The future is now. Switch to ptk 2.0 style names. * PEP8. * Flag for enable_open_in_editor. * add class:prompt to prompt * Removed workaround for #668. Some renaming. * use pgcli.completer instead of app.current_buffer.completer * enable_system_prompt=True like old prompt toolkit * keep search_ignore_case enabled (was ignore_case) * fix closing parenthese * keep marking class:continuation token for continuation * capture KeyboardInterrupt manually AbortAction has been removed in Prompt_toolkit 2.0 * replace C-J with enter, add more comments * reversed ([...]) to [(...)] (oops) * pep8 fixes * Does Vi mode have to be applied to session every time? * (workaround) also enable vi_mode after edit command * Fixed test errors after rebasing on master.
2018-09-23Merge pull request #871 from maxrothman/masterIrina Truong
Respect \pset pager on expected behavior
2018-09-23Respect \pset pager on expected behaviorMax Rothman
"\pset pager" has three possible values: "always", "on", and "off". pgcli previously treated all non-"off" values as "always". This change implements the expected behavior, which is to use the pager when the output is larger than the terminal height (See \pset pager in https://www.postgresql.org/docs/9.2/static/app-psql.html). Pgcli adds to this by also using the pager when the output is wider than the terminal width. Fixes #813
2018-09-22pep8Irina Truong
2018-09-22Revert abs imports in tests.Irina Truong
2018-09-22pep8Irina Truong
2018-09-22Attempt to fix failing tests. Add some debug info. Make imports py3-compatible.Irina Truong
2018-05-26Refactor destructive warning in behave testsDick Marinus
2018-05-20Fix typo in test fixture.Amjith Ramanujam
2018-05-18Add confirmation prompt to destructive commands in behave tests.Amjith Ramanujam
2018-04-27add test to check application_nameDick Marinus
2018-02-15New line already taken into accountPierre GIRAUD
2018-01-03change command t by Tfraoustin
2018-01-03clean helpfraoustin
2018-01-03correction spacefraoustin
2018-01-03correction testfraoustin
2017-10-24Increase timeout for quitting pgcliDick Marinus
2017-10-13Use ctrl + c instead of ctrl + u to clean up command line after tests.Irina Truong
2017-10-06Merge remote-tracking branch 'upstream/master' into ↵Dmitry B
feature_use_temp_config_for_tests