mirror of
https://github.com/launchbadge/sqlx.git
synced 2025-12-29 21:00:54 +00:00
test: fix non-repeatable postgres macro test
This commit is contained in:
parent
b46215eca8
commit
e001815a18
@ -1,4 +1,4 @@
|
||||
use sqlx::Postgres;
|
||||
use sqlx::{Connection, Postgres};
|
||||
use sqlx_test::new;
|
||||
|
||||
use futures::TryStreamExt;
|
||||
@ -22,10 +22,11 @@ async fn test_query() -> anyhow::Result<()> {
|
||||
#[sqlx_macros::test]
|
||||
async fn test_no_result() -> anyhow::Result<()> {
|
||||
let mut conn = new::<Postgres>().await?;
|
||||
let mut tx = conn.begin().await?;
|
||||
|
||||
let _ = sqlx::query!("DELETE FROM pg_enum")
|
||||
.execute(&mut conn)
|
||||
.await?;
|
||||
let _ = sqlx::query!("DELETE FROM tweet").execute(&mut tx).await?;
|
||||
|
||||
// let the transaction rollback so we don't actually delete the tweets
|
||||
|
||||
Ok(())
|
||||
}
|
||||
@ -62,7 +63,7 @@ async fn test_text_var_char_char_n() -> anyhow::Result<()> {
|
||||
}
|
||||
|
||||
#[sqlx_macros::test]
|
||||
async fn _file() -> anyhow::Result<()> {
|
||||
async fn test_query_file() -> anyhow::Result<()> {
|
||||
let mut conn = new::<Postgres>().await?;
|
||||
|
||||
// keep trailing comma as a test
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user