-
Notifications
You must be signed in to change notification settings - Fork 77
Use mock sample in tests #489
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
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #489 +/- ##
=======================================
Coverage 94.59% 94.59%
=======================================
Files 28 28
Lines 2053 2053
=======================================
Hits 1942 1942
Misses 111 111 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
66s -> 16s test suite runs. nice |
Doing for doctest would be greater reduction of time |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is pretty cool - thanks for the contribution.
On my local machine...
make test
runs in 24 seconds (down from 50 seconds on main) ✅make doctest
speed is unchanged❓
I guess I just have some questions to make sure I understand this
mock_sample_for_doctest
kind of looks transparent in that we're overridingpm.sample
withpymc.testing.mock_sample
. Though that's not working or doing much?mock_pymc_sample
is provided as an input to tests (liketest_did
for example) but it's never used anywhere in those test functions. So this is a bit confusing. Does this make the use ofsample_kwargs
irrelevant now?
Noticing that too. Weird thing is |
|
So the pm.sample is being mocked in the CI/CD tests. We can see with the drop in the run times. Need to figure out why calling EDIT: Figured out with 990104d. The conftest file was not being picked up based on the test structure |
Saving about 50s in the test suite by mocking
pm.sample
📚 Documentation preview 📚: https://causalpy--489.org.readthedocs.build/en/489/