-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Refactor test_recwarn into functional tests instead of testing private implementation #2298
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
Conversation
@@ -91,18 +94,6 @@ def test_deprecated_call_ret(self): | |||
ret = pytest.deprecated_call(self.dep, 0) | |||
assert ret == 42 | |||
|
|||
def test_deprecated_call_preserves(self): |
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.
The test is about testing the internal implementation, so I removed it.
@@ -225,9 +216,6 @@ def test_record(self): | |||
assert len(record) == 1 | |||
assert str(record[0].message) == "user" | |||
|
|||
print(repr(record[0])) |
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 was tested the recent change of the WarningMessage
object to a namedtuple
, but this is not part of the API and has never been published, so it is safe to go.
Just realized that I can make Thoughts? |
…e implementation Replace tests which test implementation details by functional tests, so we can refactor recwarn module to simplify it by using the warnings.catch_warnings builtin, available since Python 2.6.
3a5231e
to
679e92b
Compare
i strongly dislike how we turn all kinds of local component tests into system tests, its pretty much worst practice |
I agree, I was just changing them into functional because my initial take had removed the internal classes; but then afterwards I was able to keep the exact same interface as before, so we can keep the tests as they are right now. |
Replace tests which test implementation details by functional tests, so we can refactor recwarn module
to simplify it by using the warnings.catch_warnings builtin, available since Python 2.6.
I will open a new PR based upon this one with the refactor itself; I'm opening in two PRs to prove that the behavior has not changed, since I had to convert the tests to functional tests first.