Skip to content
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

[MRG] Add run and runtmp pytest fixtures. #1487

Merged
merged 3 commits into from
Apr 28, 2021
Merged

Conversation

ctb
Copy link
Contributor

@ctb ctb commented Apr 28, 2021

This PR adds run and runtmp fixtures, as a safer alternative to @utils.in_thisdir and @utils.in_tempdir decorators.

Briefly, decorators and test fixtures do not happily co-exist, and I am in need of running functions with decorators in a temp directory.

Both provide a RunnerContext object as do the current decorators, so to use them you can do e.g.

def test_me(runtmp):
    runtmp.sourmash(...)

    assert runtmp.last_result.status == 0
    assert expected_output in runtmp.last_result.out

@ctb
Copy link
Contributor Author

ctb commented Apr 28, 2021

@bluegenes @luizirber should be ready for review.

@codecov
Copy link

codecov bot commented Apr 28, 2021

Codecov Report

Merging #1487 (255014e) into latest (e2dbe24) will increase coverage by 5.13%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           latest    #1487      +/-   ##
==========================================
+ Coverage   89.76%   94.89%   +5.13%     
==========================================
  Files         123       96      -27     
  Lines       19549    15930    -3619     
  Branches     1497     1497              
==========================================
- Hits        17548    15117    -2431     
+ Misses       1775      587    -1188     
  Partials      226      226              
Flag Coverage Δ
python 94.89% <100.00%> (+<0.01%) ⬆️
rust ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
tests/conftest.py 74.46% <100.00%> (+3.73%) ⬆️
tests/test_sourmash.py 99.71% <100.00%> (-0.01%) ⬇️
src/core/src/index/linear.rs
src/core/src/wasm.rs
src/core/src/lib.rs
src/core/src/ffi/nodegraph.rs
src/core/tests/minhash.rs
src/core/src/index/bigsi.rs
src/core/src/sketch/hyperloglog/mod.rs
src/core/src/ffi/signature.rs
... and 19 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 e2dbe24...255014e. Read the comment docs.

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.

2 participants