-
-
Notifications
You must be signed in to change notification settings - Fork 70
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
[WIP] Change tests to pytest format. #639
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #639 +/- ##
========================================
Coverage 80.13% 80.13%
========================================
Files 69 69
Lines 10335 10335
========================================
Hits 8282 8282
Misses 2053 2053 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
Thanks for doing this! A few small comments before I download and run them myself. Did you do this in any sort of automated way?
Mostly a bit of regex matching and replacement with some manual fixes where it failed. |
42cca38
to
ef52ec0
Compare
415ec64
to
87f0747
Compare
I noticed tests passed, do you think this is ready for a more thorough review? |
Yes, I think this is ready for a more thorough review. Thank you for looking into it. |
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.
Thanks a ton for cleaning all this up!
Submission Checklist
Summary
This PR changes the test suite from
unittest.TestCase
format topytest
. This should, for example, allow the use of fixtures and@parametrize
decorators. To minimize the risk of this change breaking anything, it only touches files in thetest
folder. There are a lot of changes, but they are mostly trivial.Some specific changes:
assert
statements to replaceself.assert*
from theunittest.TestCase
.np.testing.*
wherever the previous code usedself.assertTrue(np.*)
.stan_file
s) to use@parameterize
decorators.unittest.mock.patch.dict
.testfixtures.LogCapture
withpytest
'scaplog
fixture.replace_stdin
byunittest.mock.patch
.It looks like other tests could benefit from using
@parameterize
decorators, but I've left them unchanged here to avoid changing both framework and logic. Changes and suggestions welcome on this work in progress.Copyright and Licensing
Please list the copyright holder for the work you are submitting (this will be you or your assignee, such as a university or company): Harvard University
By submitting this pull request, the copyright holder is agreeing to license the submitted work under the following licenses: