I want to print the exact text as the file "basic_text_info.txt" to my customized tear down method. how can i do that? #1604
Answered
by
mdmintz
poojapatel14710
asked this question in
Q&A
|
Hello sir, The below logs is from archived_logs>basic_test_info.txt and i want to use that in my different file |
Answered by
mdmintz
Nov 10, 2022
Replies: 2 comments 4 replies
|
If you call def tearDown(self):
# do things before regular tearDown()
super().tearDown()
# do things after regular tearDown()This will get you the full folder path where the individual test logs are stored per test: import os
os.path.join(os.path.abspath("."), self.log_path, self._BaseCase__get_test_id())Remember that |
1 reply
Answer selected by
mdmintz
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

If you call
super().tearDown()from your customizedtearDown()method, then thebasic_text_info.txtfile will be generated if the test has failed, and then you can use Python File-IO to get the data from thelatest_logsfolder.This will get you the full folder path where the individual test logs are stored per test:
Remember that
basic_text_info.txtis only generated for failing tests.