Synchronous connection interface
See original GitHub issueFor working from sync test cases, or for working from the console, it’d be useful to be able to acquire a synchronous interface onto a connection.
Eg.
database = Database(DATABASE_URL)
connection = database.sync_connection()
connection.execute(...)
Or…
@pytest.fixture
def connection():
return database.sync_connection()
def test_something(client, database):
client.post("/users", json=...)
assert database.fetch_all(...) = ...
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:10 (8 by maintainers)
Top Results From Across the Web
Synchronous Serial Interface - Wikipedia
Synchronous Serial Interface (SSI) is a widely used serial interface standard for industrial applications between a master (e.g. controller) and a slave ...
Read more >Synchronous Connections
Synchronous connections use independent clocking signals to synchronize ... The synchronous connection is established through a synchronous serial interface ...
Read more >Synchronous Connection - an overview | ScienceDirect Topics
The synchronous connection and communication among various components within a living cell has ... The physical layer provides the radio and air interface....
Read more >6.2.1. Synchronous Interface - Intel
Property Name Default Value Legal Value
associatedClock 1 Clock interface
associatedReset 1 Reset interface
dataBitsPerSymbol 8 1 – 8192
Read more >What Is Serial Synchronous Interface - NI - Support
Serial Synchronous Interface (SSI) is a widely used serial interface between an absolute position sensor and a controller. SSI uses a clock ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The other way around for us to approach this would be to provide an async test client.
Then we can just use
pytest.mark.asyncio
and use async test cases all the way through, with async requests and async database queries.This https://github.com/encode/requests-async gets us a lot closer to doing that, since we’ve got a package that can either be used for making outgoing async HTTP requests, or for an async test client, or plugging into a stub service to mock out network requests. (eg. when you’re running the test suite, you probably want to stub out any external network requests that your service makes.)
@gvbgduh I’m using your draft for AsyncTestClient and so far, so good. I’d love to see it get merged into Starlette.