You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: LICENSE
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
testgres is released under the PostgreSQL License, a liberal Open Source license, similar to the BSD or MIT licenses.
2
2
3
-
Copyright (c) 2016-2017, Postgres Professional
3
+
Copyright (c) 2016-2018, Postgres Professional
4
4
5
5
Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and this paragraph and the following two paragraphs appear in all copies.
|`node.psql(dbname, query)`| Runs query via `psql` command and returns tuple `(error code, stdout, stderr)`. |
111
-
|`node.safe_psql(dbname, query)`| Same as `psql()` except that it returns only `stdout`. If an error occures during the execution, an exception will be thrown. |
112
-
|`node.execute(dbname, query)`| Connects to PostgreSQL using `psycopg2` or `pg8000` (depends on which one is installed in your system) and returns two-dimensional array with data. |
113
-
|`node.connect(dbname, username)`| Returns connection wrapper (`NodeConnection`) capable of running several queries within a single transaction. |
64
+
|`node.psql(query, ...)`| Runs query via `psql` command and returns tuple `(error code, stdout, stderr)`. |
65
+
|`node.safe_psql(query, ...)`| Same as `psql()` except that it returns only `stdout`. If an error occures during the execution, an exception will be thrown. |
66
+
|`node.execute(query, ...)`| Connects to PostgreSQL using `psycopg2` or `pg8000` (depends on which one is installed in your system) and returns two-dimensional array with data. |
67
+
|`node.connect(dbname, ...)`| Returns connection wrapper (`NodeConnection`) capable of running several queries within a single transaction. |
114
68
115
69
The last one is the most powerful: you can use `begin(isolation_level)`, `commit()` and `rollback()`:
116
70
```python
@@ -120,12 +74,39 @@ with node.connect() as con:
120
74
con.rollback()
121
75
```
122
76
123
-
To stop the server, run:
77
+
78
+
### Logging
79
+
80
+
By default, `cleanup()` removes all temporary files (DB files, logs etc) that were created by testgres' API methods.
81
+
If you'd like to keep logs, execute `configure_testgres(node_cleanup_full=False)` before running any tests.
0 commit comments