-
Notifications
You must be signed in to change notification settings - Fork 73
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
[PH] Replace usage of os.path with Path and PurePath #571
[PH] Replace usage of os.path with Path and PurePath #571
Conversation
testSuccessful = False | ||
|
||
# Test log scraping for 3.2 log format | ||
dataCurrent = log_reader.chainData() | ||
dataCurrent.startBlock = None | ||
dataCurrent.ceaseBlock = None | ||
log_reader.scrapeLog(dataCurrent, "tests/performance_tests/nodeos_log_3_2.txt.gz") | ||
log_reader.scrapeLog(dataCurrent, Path("tests")/Path("performance_tests")/Path("nodeos_log_3_2.txt.gz")) |
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 /
operator supported by Path
accepts strings as well as Path
objects, including chains of strings, as long as the first part is a Path
. I prefer to write this sort of thing as Path('tests') / 'performance_tests' / 'nodeos_log_3_2.txt.gz'
since it's less verbose. This includes f-strings.
Replaces instances of os.path with corresponding Path and PurePath. str conversion is necessary for use with sys.path