-
Notifications
You must be signed in to change notification settings - Fork 24
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
RFC: Use AssertionError
when inside decorated test case
#12
base: master
Are you sure you want to change the base?
Conversation
- Stops at first failure like most other test frameworks - Single test passed message regardless of the number of assertions - Discourage fat test cases - Allow using external assertions - `np.testing.assert_equal` - `pd.testing.assert_frame_equal` - assertion packages
try: | ||
func() | ||
if is_test_case: | ||
display("PASSED", "Test Passed") |
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 will show extra <PASSED::>
if any assertion functions were used inside some wrapper.
AssertionError
when inside decorated test caseAssertionError
when inside decorated test case
Are you interested in feedback on the design, code/style, both, or some other aspect(s)? |
Any feedback. But I'm honestly starting to think it's better to spend time on figuring out how to allow kata authors to choose |
I'm curious what the rationale is behind limiting the |
I'm not sure what you mean by So old tests not using decorators looks like this: test.it("old test")
test.assert_equals(1, 2) If this |
Maybe "handle" is a better term. No particular line--the design seems based on |
That comment means import codewars_test as test
@test.describe("group 1")
def group_1():
@test.it("test 1")
def test_1():
test.assert_equals(1, 2) works, but import codewars_test as test
def wrapped_equal(a, b):
test.assert_equal(a, b)
@test.describe("group 1")
def group_1():
@test.it("test 1")
def test_1():
wrapped_equal(1, 2) doesn't because of the way it currently checks if it's inside a test case. We can make it work better, but I didn't think it's worth it for RFC.
We can do that if we didn't have to worry about the existing tests using assertions from this package ( |
Also, to be clear, that limitation only applies for assertions from this package. Anything that throws |
np.testing.assert_equal
pd.testing.assert_frame_equal
Tests written in old style are not affected.
Need some review and feedback.
Closes #9