Skip to content

Commit 1469b12

Browse files
committed
Fix doc tests in wp_mobile_cache by marking complex examples as ignore
The failing doc tests required rstest fixtures and database connections that aren't available in doc test context. Marking them as 'ignore' keeps the examples in the documentation while skipping compilation during doc tests.
1 parent a6b44c3 commit 1469b12

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

wp_mobile_cache/src/test_fixtures.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pub mod posts;
2121
///
2222
/// # Example
2323
///
24-
/// ```rust
24+
/// ```rust,ignore
2525
/// #[rstest]
2626
/// fn test_something(mut test_ctx: TestContext) {
2727
/// let post = PostBuilder::new().build();
@@ -87,7 +87,7 @@ static RANDOM_TEST_SITE_COUNTER: AtomicU32 = AtomicU32::new(1);
8787
///
8888
/// # Example
8989
///
90-
/// ```rust
90+
/// ```rust,ignore
9191
/// let site1 = create_random_test_site(&mut conn);
9292
/// let site2 = create_random_test_site(&mut conn);
9393
/// // site1 and site2 will have different URLs
@@ -144,7 +144,7 @@ pub fn assert_recent_timestamp(timestamp: &str) {
144144
///
145145
/// # Example
146146
///
147-
/// ```rust
147+
/// ```rust,ignore
148148
/// use PostEditContextColumn::*;
149149
///
150150
/// let columns = get_table_column_names(&conn, "posts_edit_context");

wp_mobile_cache/src/test_fixtures/posts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub enum PostBuilderInitialState {
2626
///
2727
/// # Example
2828
///
29-
/// ```rust
29+
/// ```rust,ignore
3030
/// // Minimal post with custom fields
3131
/// let post1 = PostBuilder::minimal()
3232
/// .with_author(UserId(10))

0 commit comments

Comments
 (0)