-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
Replace unittests
test cases by pure pytest
[Wave-1]
#26831
Replace unittests
test cases by pure pytest
[Wave-1]
#26831
Conversation
def test_does_send_stats_using_dogstatsd_when_statsd_and_dogstatsd_both_on(self): | ||
# ToDo: Figure out why it identical to test_does_send_stats_using_dogstatsd_when_dogstatsd_on | ||
self.dogstatsd.incr("empty_key") | ||
self.dogstatsd_client.increment.assert_called_once_with( | ||
metric='empty_key', sample_rate=1, tags=[], value=1 |
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.
Just add todo to figure out later why implementation same as test_does_send_stats_using_dogstatsd_when_dogstatsd_on
3c1a0dd
to
614d3dd
Compare
def test_markdown_none(self): | ||
rendered = self.attr_renderer["python_callable"](None) | ||
assert "" == rendered | ||
rendered = self.attr_renderer["doc_md"](None) | ||
assert rendered is None |
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.
Also "fix" this test seems like it just copy of test_python_callable_none
but name of the test more related to doc_md
attribute
614d3dd
to
d9988a1
Compare
d9988a1
to
4c1f0d1
Compare
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.
I didn’t read everything, but this seems straightforward enough from the 10-ish files I sampled. This should be good as long as CI passes.
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.
COOL!
(cherry picked from commit 1c7c976)
(cherry picked from commit 1c7c976)
A lot of tests still uses
unittest.TestCase
class as base method for test classes as well as internals of this class. May be it a good time to start convert tests to use nativepytest
functionality.Total number of modules which uses
unittest.TestCase
Total number of modules which uses
unittest.TestCase
Total number of providers tests submodules which uses
unittest.TestCase
(by submodules)Note: "apache", "microsoft", "common" has own sub-packages which contains separate providers
This PR focus on only simple changes in tests exclude
providers
andcharts
:unittest.TestCase
setUp
method ->setup_method
tearDown
method ->teardown_method
setUpClass
classmethod ->setup_class
tearDownClass
->teardown_class
parameterized.expand
decorator ->pytest.mark.parametrize
self.assertRaises
context manager ->pytest.raises
Result after changes