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

Tests for distributions.py #324

Merged
merged 1 commit into from
Aug 16, 2017
Merged

Conversation

QBatista
Copy link
Member

Adds tests for distributions.py

Close #301

@coveralls
Copy link

Coverage Status

Coverage increased (+0.4%) to 92.549% when pulling 1d873ae on QBatista:test-distributions into 64d964c on QuantEcon:master.

def test_init(self):
assert_allclose(self.n, self.test_obj.n)
assert_allclose(self.a, self.test_obj.a)
assert_allclose(self.b, self.test_obj.b)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should have told you this, but for equality between scalars, you can use eq_ from nose.tools:

from nose.tools import eq_

eq_(self.test_obj.n, self.n)

self.b = 1
self.test_obj = BetaBinomial(self.n, self.a, self.b)
for prob in self.test_obj.pdf():
assert_allclose(0.1, prob)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this you can use assert_allclose:

assert_allclose(test_obj.pdf(), np.full(n+1, 1/(n+1)))

@coveralls
Copy link

Coverage Status

Coverage increased (+0.4%) to 92.551% when pulling e18d9b2 on QBatista:test-distributions into 64d964c on QuantEcon:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.4%) to 92.549% when pulling 4ec9e93 on QBatista:test-distributions into 64d964c on QuantEcon:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.4%) to 92.549% when pulling 4ec9e93 on QBatista:test-distributions into 64d964c on QuantEcon:master.

@mmcky mmcky merged commit 7808f02 into QuantEcon:master Aug 16, 2017
@mmcky
Copy link
Contributor

mmcky commented Aug 16, 2017

thanks @oyamad for approval. Thanks @QBatista for the contribution.

@QBatista QBatista deleted the test-distributions branch September 23, 2017 06:51
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.

None yet

4 participants