Skip to content

Add tests for the guide book using docmatic #142

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
May 2, 2018
Merged

Add tests for the guide book using docmatic #142

merged 11 commits into from
May 2, 2018

Conversation

althonos
Copy link
Member

@althonos althonos commented Apr 21, 2018

Related to #84,

I used docmatic to generate tests for the documentation, and updated the failing test cases to work with modern versions of the library. Some tests are ignored because they won't compile (for instance the example for Into<PyErr> implementation will not compile since the std::io::Error was not declared in our module).

@codecov-io
Copy link

codecov-io commented Apr 21, 2018

Codecov Report

Merging #142 into master will increase coverage by 8.14%.
The diff coverage is 92.85%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #142      +/-   ##
==========================================
+ Coverage   72.77%   80.91%   +8.14%     
==========================================
  Files          80       82       +2     
  Lines        3772     4978    +1206     
==========================================
+ Hits         2745     4028    +1283     
+ Misses       1027      950      -77
Impacted Files Coverage Δ
tests/test_doc.rs 92.85% <92.85%> (ø)
src/ffi3/modsupport.rs 0% <0%> (-50%) ⬇️
src/ffi3/methodobject.rs 0% <0%> (-33.34%) ⬇️
src/class/iter.rs 83.33% <0%> (-16.67%) ⬇️
src/class/sequence.rs 98.07% <0%> (-1.93%) ⬇️
src/class/macros.rs 82.89% <0%> (-0.44%) ⬇️
src/class/context.rs 100% <0%> (ø) ⬆️
tests/test_buffer_protocol.rs 100% <0%> (ø) ⬆️
tests/test_slice.rs 100% <0%> (ø) ⬆️
tests/test_module.rs
... and 26 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5a8f503...b80b855. Read the comment docs.

@fafhrd91
Copy link
Contributor

fafhrd91 commented May 1, 2018

could you add config to the travis config, so travis runs tests on each commit?

@althonos
Copy link
Member Author

althonos commented May 1, 2018

@fafhrd91 : once this is merged all tests will be invoked through cargo test, nothing needs to be changed in the CI workflow

@fafhrd91
Copy link
Contributor

fafhrd91 commented May 1, 2018

Good. Thanks

# #![feature(proc_macro, specialization, const_fn)]
# extern crate pyo3;
# use pyo3::prelude::*;
# #[py::class]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

py::class will fail on the latest nightly; In #147 I've changed all other occurrences of this to

use pyo3::py::class as pyclass;

#[pyclass]

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll rebase against the current master then, and remove other occurences. Thanks for the hint !

Cargo.toml Outdated
@@ -25,6 +25,9 @@ spin = "0.4.6"
num-traits = "0.2"
pyo3cls = { version = "^0.2.1" }

[dev-dependencies]
docmatic = { version = "^0.1", git = "https://github.com/assert-rs/docmatic" }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like docmatic has now been published to crates.io, so we can use that version.

Copy link
Member Author

@althonos althonos May 1, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also need to bump the required version to 0.1.2 since I need features I PR'd into the latest release 😉

@althonos althonos merged commit b64977f into PyO3:master May 2, 2018
@althonos
Copy link
Member Author

althonos commented May 2, 2018

Merging before I need to rebase again. Thanks @messense @konstin @fafhrd91 !

@althonos althonos mentioned this pull request May 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants