Merge pull request #469 from PyO3/remove_doc_comment

Remove doc-comment
This commit is contained in:
konstin 2019-04-28 18:26:51 +02:00 committed by GitHub
commit c6a5c054e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 34 additions and 20 deletions

View file

@ -26,7 +26,6 @@ pyo3cls = { path = "pyo3cls", version = "=0.7.0-alpha.1" }
mashup = "0.1.9"
num-complex = { version = "0.2.1", optional = true }
inventory = "0.1.3"
doc-comment = "0.3"
[dev-dependencies]
assert_approx_eq = "1.1.0"

View file

@ -116,25 +116,6 @@
//! Ok(())
//! }
//! ```
use doc_comment::doctest;
// Test readme and user guide
doctest!("../README.md", readme_md);
doctest!("../guide/src/advanced.md", guide_advanced_md);
doctest!(
"../guide/src/building_and_distribution.md",
guide_building_and_distribution_md
);
doctest!("../guide/src/class.md", guide_class_md);
doctest!("../guide/src/conversions.md", guide_conversions_md);
doctest!("../guide/src/debugging.md", guide_debugging_md);
doctest!("../guide/src/exception.md", guide_exception_md);
doctest!("../guide/src/function.md", guide_function_md);
doctest!("../guide/src/get_started.md", guide_get_started_md);
doctest!("../guide/src/module.md", guide_module_md);
doctest!("../guide/src/parallelism.md", guide_parallelism_md);
doctest!("../guide/src/pypy.md", guide_pypy_md);
doctest!("../guide/src/rust_cpython.md", guide_rust_cpython_md);
pub use crate::class::*;
pub use crate::conversion::{
@ -228,3 +209,37 @@ macro_rules! wrap_pymodule {
}
}};
}
/// Test readme and user guide
#[doc(hidden)]
pub mod doc_test {
macro_rules! doc_comment {
($x:expr, $($tt:tt)*) => {
#[doc = $x]
$($tt)*
};
}
macro_rules! doctest {
($x:expr, $y:ident) => {
doc_comment!(include_str!($x), mod $y {});
};
}
doctest!("../README.md", readme_md);
doctest!("../guide/src/advanced.md", guide_advanced_md);
doctest!(
"../guide/src/building_and_distribution.md",
guide_building_and_distribution_md
);
doctest!("../guide/src/class.md", guide_class_md);
doctest!("../guide/src/conversions.md", guide_conversions_md);
doctest!("../guide/src/debugging.md", guide_debugging_md);
doctest!("../guide/src/exception.md", guide_exception_md);
doctest!("../guide/src/function.md", guide_function_md);
doctest!("../guide/src/get_started.md", guide_get_started_md);
doctest!("../guide/src/module.md", guide_module_md);
doctest!("../guide/src/parallelism.md", guide_parallelism_md);
doctest!("../guide/src/pypy.md", guide_pypy_md);
doctest!("../guide/src/rust_cpython.md", guide_rust_cpython_md);
}