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

Migrating examples to integration tests to be run by pytest #371

Merged
merged 5 commits into from
Feb 8, 2024

Conversation

mattkwiecien
Copy link
Contributor

We currently have 9 examples we run after tests to check the code is working as expected. This code moves those examples into tests that can be run by pytest.

  • Added a new tests/integration directory
  • Placed tests that use subprocess.run to run the examples in this directory and marked them as integration tests
    • I prefixed set -e to ensure the test fails if any commands fail
    • I capture the stdout and print it to the terminal to mimic the previous behavior.
  • Updated pytest to skip integration tests unless requested with the --integration flag.
  • Updated ci.yml to run integration tests after unit tests, and appending the output to the coverage file.

Copy link

codecov bot commented Feb 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (da20744) 95.4% compared to head (92ddc4f) 96.2%.

Additional details and impacted files
@@           Coverage Diff            @@
##           master    #371     +/-   ##
========================================
+ Coverage    95.4%   96.2%   +0.8%     
========================================
  Files          35      35             
  Lines        2569    2569             
========================================
+ Hits         2451    2472     +21     
+ Misses        118      97     -21     

see 3 files with indirect coverage changes

@marcpaterno marcpaterno self-requested a review February 8, 2024 18:31
@marcpaterno marcpaterno merged commit d76c115 into master Feb 8, 2024
8 checks passed
@marcpaterno marcpaterno deleted the pytest-examples branch February 8, 2024 18:35
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