-
-
Notifications
You must be signed in to change notification settings - Fork 199
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
Simple test of initialization of IncomeDstn of IndShockConsumerType. #256
Conversation
Thank you, this is exactly what I need for today's sprint.
…On Thu, Apr 25, 2019, 5:32 AM Patrick Kofod Mogensen < ***@***.***> wrote:
cc @mnwhite <https://github.com/mnwhite> @llorracc
<https://github.com/llorracc>
The other tests are also quite simple, but see here for a very simple
example for how to add a test to the HARK/tests folder.
The template is:
- import unittest for the TestCase class
- define at least one (but you can do more in one file) class that
inherits from unittest.TestCase
- define methods that start with test_ and do the test with an
assertion. You can do multiple tests in each class by defining multiple
methods
Add files, commit, push, and it should be tested on CI!
------------------------------
You can view, comment on, or merge this pull request online at:
#256
Commit Summary
- Test initialization of IndShockConsumerType.
File Changes
- *A* HARK/tests/test_ConsIndShockInit.py
<https://github.com/econ-ark/HARK/pull/256/files#diff-0> (25)
Patch Links:
- https://github.com/econ-ark/HARK/pull/256.patch
- https://github.com/econ-ark/HARK/pull/256.diff
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#256>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADKRAFJP2TJFYC5JBNRKQETPSF3C3ANCNFSM4HILLMLA>
.
|
Great, that was the motivation. I added a few comments about the |
Yeah, I started reading that this morning. Possibly dumb question: Does
Travis know to treat every file of the form /HARK/tests/test_*.py as a
unittest? Or do we have to name/list those files individually somewhere?
…On Thu, Apr 25, 2019 at 8:24 AM Patrick Kofod Mogensen < ***@***.***> wrote:
Thank you, this is exactly what I need for today's sprint.
Great, that was the motivation. I added a few comments about the setUp
and `tearDown' methods - they are optional. Of course, I should also point
to the documentation for good measure
https://docs.python.org/3/library/unittest.html
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#256 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ADKRAFMBCGOZCAWBTWS34MTPSGPJDANCNFSM4HILLMLA>
.
|
Yes, it will run all those files automatically. |
I think this should just be merged. |
Will do this morning. As you said on the other thread, we need init tests
for all of our classes as well.
…On Tue, May 14, 2019, 7:41 AM Patrick Kofod Mogensen < ***@***.***> wrote:
I think this should just be merged.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#256?email_source=notifications&email_token=ADKRAFPWQIAQD55UM2XWUUTPVKQN7A5CNFSM4HILLMLKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVLGSYY#issuecomment-492202339>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADKRAFKRZD7JESC6N5L6NFLPVKQN7ANCNFSM4HILLMLA>
.
|
@pkofod can you add a release note? |
Release note: Add some unit tests for IndShockConsumerType |
cc @mnwhite @llorracc
The other tests are also quite simple, but see here for a very simple example for how to add a test to the
HARK/tests
folder.The template is:
unittest
for theTestCase
classunittest.TestCase
setUp
method to set up variables before eachtest_*
method is called (see below) (you can also define atearDown
method to destroy objects after each testtest_
and do the test with an assertion. You can do multiple tests in each class by defining multiple methodsAdd files, commit, push, and it should be tested on CI!