Remove redundant track_callers which now cause errors on nightly (#5839)
This commit is contained in:
parent
b722a34102
commit
019ae25847
|
|
@ -315,7 +315,6 @@ impl<Request, Response, Error> MockService<Request, Response, PanicAssertion, Er
|
||||||
/// assert!(matches!(call.await, Ok(Ok("response"))));
|
/// assert!(matches!(call.await, Ok(Ok("response"))));
|
||||||
/// # });
|
/// # });
|
||||||
/// ```
|
/// ```
|
||||||
#[track_caller]
|
|
||||||
pub async fn expect_request(
|
pub async fn expect_request(
|
||||||
&mut self,
|
&mut self,
|
||||||
expected: Request,
|
expected: Request,
|
||||||
|
|
@ -372,7 +371,6 @@ impl<Request, Response, Error> MockService<Request, Response, PanicAssertion, Er
|
||||||
/// assert!(matches!(call.await, Ok(Ok("response"))));
|
/// assert!(matches!(call.await, Ok(Ok("response"))));
|
||||||
/// # });
|
/// # });
|
||||||
/// ```
|
/// ```
|
||||||
#[track_caller]
|
|
||||||
pub async fn expect_request_that(
|
pub async fn expect_request_that(
|
||||||
&mut self,
|
&mut self,
|
||||||
condition: impl FnOnce(&Request) -> bool,
|
condition: impl FnOnce(&Request) -> bool,
|
||||||
|
|
@ -420,7 +418,6 @@ impl<Request, Response, Error> MockService<Request, Response, PanicAssertion, Er
|
||||||
/// mock_service.expect_no_requests().await;
|
/// mock_service.expect_no_requests().await;
|
||||||
/// # });
|
/// # });
|
||||||
/// ```
|
/// ```
|
||||||
#[track_caller]
|
|
||||||
pub async fn expect_no_requests(&mut self)
|
pub async fn expect_no_requests(&mut self)
|
||||||
where
|
where
|
||||||
Request: Debug,
|
Request: Debug,
|
||||||
|
|
@ -446,7 +443,6 @@ impl<Request, Response, Error> MockService<Request, Response, PanicAssertion, Er
|
||||||
///
|
///
|
||||||
/// If the queue is empty and a request is not received before the max request delay timeout
|
/// If the queue is empty and a request is not received before the max request delay timeout
|
||||||
/// expires.
|
/// expires.
|
||||||
#[track_caller]
|
|
||||||
async fn next_request(&mut self) -> ResponseSender<Request, Response, Error> {
|
async fn next_request(&mut self) -> ResponseSender<Request, Response, Error> {
|
||||||
match self.try_next_request().await {
|
match self.try_next_request().await {
|
||||||
Some(request) => request,
|
Some(request) => request,
|
||||||
|
|
@ -507,7 +503,6 @@ impl<Request, Response, Error> MockService<Request, Response, PropTestAssertion,
|
||||||
/// # test_code().await
|
/// # test_code().await
|
||||||
/// # }).unwrap();
|
/// # }).unwrap();
|
||||||
/// ```
|
/// ```
|
||||||
#[track_caller]
|
|
||||||
pub async fn expect_request(
|
pub async fn expect_request(
|
||||||
&mut self,
|
&mut self,
|
||||||
expected: Request,
|
expected: Request,
|
||||||
|
|
@ -574,7 +569,6 @@ impl<Request, Response, Error> MockService<Request, Response, PropTestAssertion,
|
||||||
/// # test_code().await
|
/// # test_code().await
|
||||||
/// # }).unwrap();
|
/// # }).unwrap();
|
||||||
/// ```
|
/// ```
|
||||||
#[track_caller]
|
|
||||||
pub async fn expect_request_that(
|
pub async fn expect_request_that(
|
||||||
&mut self,
|
&mut self,
|
||||||
condition: impl FnOnce(&Request) -> bool,
|
condition: impl FnOnce(&Request) -> bool,
|
||||||
|
|
@ -629,7 +623,6 @@ impl<Request, Response, Error> MockService<Request, Response, PropTestAssertion,
|
||||||
/// # test_code().await
|
/// # test_code().await
|
||||||
/// # }).unwrap();
|
/// # }).unwrap();
|
||||||
/// ```
|
/// ```
|
||||||
#[track_caller]
|
|
||||||
pub async fn expect_no_requests(&mut self) -> Result<(), TestCaseError>
|
pub async fn expect_no_requests(&mut self) -> Result<(), TestCaseError>
|
||||||
where
|
where
|
||||||
Request: Debug,
|
Request: Debug,
|
||||||
|
|
@ -657,7 +650,6 @@ impl<Request, Response, Error> MockService<Request, Response, PropTestAssertion,
|
||||||
///
|
///
|
||||||
/// If the queue is empty and a request is not received before the max request delay timeout
|
/// If the queue is empty and a request is not received before the max request delay timeout
|
||||||
/// expires, an error generated by a [`mod@proptest`] assertion is returned.
|
/// expires, an error generated by a [`mod@proptest`] assertion is returned.
|
||||||
#[track_caller]
|
|
||||||
async fn next_request(
|
async fn next_request(
|
||||||
&mut self,
|
&mut self,
|
||||||
) -> Result<ResponseSender<Request, Response, Error>, TestCaseError> {
|
) -> Result<ResponseSender<Request, Response, Error>, TestCaseError> {
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,17 @@
|
||||||
//! A [`Service`](tower::Service) implementation based on a fixed transcript.
|
//! A [`Service`](tower::Service) implementation based on a fixed transcript.
|
||||||
|
|
||||||
|
use std::{
|
||||||
|
fmt::Debug,
|
||||||
|
sync::Arc,
|
||||||
|
task::{Context, Poll},
|
||||||
|
};
|
||||||
|
|
||||||
use color_eyre::{
|
use color_eyre::{
|
||||||
eyre::{eyre, Report, WrapErr},
|
eyre::{eyre, Report, WrapErr},
|
||||||
section::Section,
|
section::Section,
|
||||||
section::SectionExt,
|
section::SectionExt,
|
||||||
};
|
};
|
||||||
use futures::future::{ready, Ready};
|
use futures::future::{ready, Ready};
|
||||||
use std::{
|
|
||||||
fmt::Debug,
|
|
||||||
sync::Arc,
|
|
||||||
task::{Context, Poll},
|
|
||||||
};
|
|
||||||
use tower::{Service, ServiceExt};
|
use tower::{Service, ServiceExt};
|
||||||
|
|
||||||
type BoxError = Box<dyn std::error::Error + Send + Sync + 'static>;
|
type BoxError = Box<dyn std::error::Error + Send + Sync + 'static>;
|
||||||
|
|
@ -90,7 +91,6 @@ where
|
||||||
S: Debug + Eq,
|
S: Debug + Eq,
|
||||||
{
|
{
|
||||||
/// Check this transcript against the responses from the `to_check` service
|
/// Check this transcript against the responses from the `to_check` service
|
||||||
#[track_caller]
|
|
||||||
pub async fn check<C>(mut self, mut to_check: C) -> Result<(), Report>
|
pub async fn check<C>(mut self, mut to_check: C) -> Result<(), Report>
|
||||||
where
|
where
|
||||||
C: Service<R, Response = S>,
|
C: Service<R, Response = S>,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue