-
Notifications
You must be signed in to change notification settings - Fork 581
修正endpoint resolver相关测试;测试能够自动创建RAM相关环境 #160
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
|
|
||
| class NewEndpointTest(SDKTestBase): | ||
|
|
||
| def setUp(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.
是不是应该有个对应的 tearDown
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.
不用,没有环境需要销毁。tearDown多数情况下是为了防止影响以后的测试,或者释放资源。
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.
如果后续有 testcase 增加的时候 可能会踩到这个坑。
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.
DefaultEndpointResolver.predefined_endpoint_resolver = UserCustomizedEndpointResolver()
这个语句的作用是将 DefaultEndpointResolver 恢复到初始状态。应该不会有任何一个测试用例依赖其他case运行后的状态。
|
|
||
| cd - | ||
| coverage run --branch -m pytest ./ | ||
| coverage run --branch -m unittest2 discover -s . -p "*_test.py" |
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.
unittest2 是给 python2.6 用的。
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.
unittest2 is a backport of the new features added to the unittest testing framework in Python 2.7 and onwards. It is tested to run on Python 2.6, 2.7, 3.2, 3.3, 3.4 and pypy.
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.
已经设置仅在2.6中使用unittest2
JacksonTian
left a comment
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.
unittest2 应该是不对的。
Codecov Report
@@ Coverage Diff @@
## master #160 +/- ##
==========================================
+ Coverage 89.52% 89.59% +0.07%
==========================================
Files 66 66
Lines 2921 2922 +1
Branches 212 212
==========================================
+ Hits 2615 2618 +3
+ Misses 285 284 -1
+ Partials 21 20 -1
Continue to review full report at Codecov.
|
No description provided.