Skip to content

Fix typos #152

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ with testgres.get_new_node() as node:
# ... node stops and its files are about to be removed
```

There are four API methods for runnig queries:
There are four API methods for running queries:

| Command | Description |
|----------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|
| `node.psql(query, ...)` | Runs query via `psql` command and returns tuple `(error code, stdout, stderr)`. |
| `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. |
| `node.safe_psql(query, ...)` | Same as `psql()` except that it returns only `stdout`. If an error occurs during the execution, an exception will be thrown. |
| `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. |
| `node.connect(dbname, ...)` | Returns connection wrapper (`NodeConnection`) capable of running several queries within a single transaction. |

Expand Down
4 changes: 2 additions & 2 deletions testgres/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -1143,7 +1143,7 @@ def restore(self, filename, dbname=None, username=None):
filename
] # yapf: disable

# try pg_restore if dump is binary formate, and psql if not
# try pg_restore if dump is binary format, and psql if not
try:
execute_utility(_params, self.utils_log_name)
except ExecUtilException:
Expand Down Expand Up @@ -1286,7 +1286,7 @@ def set_synchronous_standbys(self, standbys):

Args:
standbys: either :class:`.First` or :class:`.Any` object specifying
sychronization parameters or just a plain list of
synchronization parameters or just a plain list of
:class:`.PostgresNode`s replicas which would be equivalent
to passing ``First(1, <list>)``. For PostgreSQL 9.5 and below
it is only possible to specify a plain list of standbys as
Expand Down
2 changes: 1 addition & 1 deletion testgres/plugins/pg_probackup2/pg_probackup2/gdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def __init__(self, cmd, env, attach=False):
" to run GDB tests")
raise GdbException("No gdb usage possible.")

# Check gdb presense
# Check gdb presence
try:
gdb_version, _ = subprocess.Popen(
['gdb', '--version'],
Expand Down
8 changes: 4 additions & 4 deletions tests/test_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,15 +501,15 @@ def test_logical_replication(self):
sub.disable()
node1.safe_psql('insert into test values (3, 3)')

# enable and ensure that data successfully transfered
# enable and ensure that data successfully transferred
sub.enable()
sub.catchup()
res = node2.execute('select * from test')
self.assertListEqual(res, [(1, 1), (2, 2), (3, 3)])

# Add new tables. Since we added "all tables" to publication
# (default behaviour of publish() method) we don't need
# to explicitely perform pub.add_tables()
# to explicitly perform pub.add_tables()
create_table = 'create table test2 (c char)'
node1.safe_psql(create_table)
node2.safe_psql(create_table)
Expand All @@ -526,7 +526,7 @@ def test_logical_replication(self):
pub.drop()

# create new publication and subscription for specific table
# (ommitting copying data as it's already done)
# (omitting copying data as it's already done)
pub = node1.publish('newpub', tables=['test'])
sub = node2.subscribe(pub, 'newsub', copy_data=False)

Expand All @@ -535,7 +535,7 @@ def test_logical_replication(self):
res = node2.execute('select * from test')
self.assertListEqual(res, [(1, 1), (2, 2), (3, 3), (4, 4)])

# explicitely add table
# explicitly add table
with self.assertRaises(ValueError):
pub.add_tables([]) # fail
pub.add_tables(['test2'])
Expand Down
8 changes: 4 additions & 4 deletions tests/test_simple_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,15 +480,15 @@ def test_logical_replication(self):
sub.disable()
node1.safe_psql('insert into test values (3, 3)')

# enable and ensure that data successfully transfered
# enable and ensure that data successfully transferred
sub.enable()
sub.catchup()
res = node2.execute('select * from test')
self.assertListEqual(res, [(1, 1), (2, 2), (3, 3)])

# Add new tables. Since we added "all tables" to publication
# (default behaviour of publish() method) we don't need
# to explicitely perform pub.add_tables()
# to explicitly perform pub.add_tables()
create_table = 'create table test2 (c char)'
node1.safe_psql(create_table)
node2.safe_psql(create_table)
Expand All @@ -505,7 +505,7 @@ def test_logical_replication(self):
pub.drop()

# create new publication and subscription for specific table
# (ommitting copying data as it's already done)
# (omitting copying data as it's already done)
pub = node1.publish('newpub', tables=['test'])
sub = node2.subscribe(pub, 'newsub', copy_data=False)

Expand All @@ -514,7 +514,7 @@ def test_logical_replication(self):
res = node2.execute('select * from test')
self.assertListEqual(res, [(1, 1), (2, 2), (3, 3), (4, 4)])

# explicitely add table
# explicitly add table
with self.assertRaises(ValueError):
pub.add_tables([]) # fail
pub.add_tables(['test2'])
Expand Down