mirror of https://github.com/citusdata/citus.git
Add pytest test example about connecting to a worker (#7386)
I noticed while reviewing #7203 that there as no example of executing sql on a worker for the pytest README. Since this is a pretty common thing that people want to do, this PR adds that.pull/7388/head
parent
fcfedff8d1
commit
5ec056a172
|
@ -82,6 +82,7 @@ the name of the fixture. For example:
|
||||||
```python
|
```python
|
||||||
def test_some_query(cluster):
|
def test_some_query(cluster):
|
||||||
cluster.coordinator.sql("SELECT 1")
|
cluster.coordinator.sql("SELECT 1")
|
||||||
|
assert cluster.workers[0].sql_value('SELECT 2') == 2
|
||||||
```
|
```
|
||||||
|
|
||||||
If you need a cluster of a specific size you can use the `cluster_factory`
|
If you need a cluster of a specific size you can use the `cluster_factory`
|
||||||
|
|
Loading…
Reference in New Issue