forked from catherinedevlin/ipython-sql
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add: test - error when there is no active connection (catherinedevlin…
…#171) (catherinedevlin#189) * Add: test * Fix: pytest * Revert * Revert * Move: _get_curr_connection_info to classmethod level * Move: pytest fixture cleanup * pins jupyter-book<0.14 (catherinedevlin#181) * ci * pins jupyter book * Add: f-string fix * Fix: arg self -> cls * Fix: arg self -> cls --------- Co-authored-by: Eduardo Blancas <[email protected]>
- Loading branch information
1 parent
ecd91c1
commit 5199b51
Showing
5 changed files
with
20 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,8 +37,8 @@ def test_alias(cleanup): | |
|
||
|
||
def test_get_curr_connection_info(mock_postgres): | ||
conn = Connection.from_connect_str("postgresql://user:[email protected]/db") | ||
assert conn._get_curr_connection_info() == { | ||
Connection.from_connect_str("postgresql://user:[email protected]/db") | ||
assert Connection._get_curr_connection_info() == { | ||
"dialect": "postgresql", | ||
"driver": "psycopg2", | ||
"server_version_info": None, | ||
|
@@ -92,3 +92,8 @@ def test_missing_driver( | |
Connection.from_connect_str(connect_str) | ||
|
||
assert "try to install package: " + missing_pkg in str(error.value) | ||
|
||
|
||
def test_no_current_connection_and_get_info(monkeypatch): | ||
monkeypatch.setattr(Connection, "current", None) | ||
assert Connection._get_curr_connection_info() is None |