-
Notifications
You must be signed in to change notification settings - Fork 50
[Refine #76] Avoid storing test data in repo. #84
Conversation
word = 'Spanish' | ||
timeout = 5 | ||
raw_html = d._get_raw(word, timeout) | ||
record = d.query(word, timeout) |
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.
It seems that there is no function requires it but test_show
.
How about just setup it as local variable of test_show
?
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.
Ok, i found that test_query_normal
require it.
Ignore previous 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.
I will suggest that pust line 9-13 in a setup/teardown method.
ref: https://pytest.org/latest/xunit_setup.html#method-and-function-level-setup-teardown
e.g.
class TestSpansisDict:
def setup_method(self, method):
self.d = SpanihDict()
...
def teardown_method(self, method):
del self.d
del ...
This snippet can ensure our each testing method not to be effect by other else testing method. (or say isolation our testing method).
I think those vars (self.d
, self.record
... etc) can consider as kind of fixture, so prepare them in setup
methd will be resonable.
|
ref #76