question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Synchronous connection interface

See original GitHub issue

For 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:open
  • Created 5 years ago
  • Reactions:3
  • Comments:10 (8 by maintainers)

github_iconTop GitHub Comments

4reactions
tomchristiecommented, Mar 21, 2019

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.)

1reaction
taybincommented, Sep 12, 2019

@gvbgduh I’m using your draft for AsyncTestClient and so far, so good. I’d love to see it get merged into Starlette.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found