Skip to content
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

Conversation

ClaytonCalabrese
Copy link
Contributor

Replaces instances of os.path with corresponding Path and PurePath. str conversion is necessary for use with sys.path

tests/performance_tests/performance_test.py Outdated Show resolved Hide resolved
tests/performance_tests/performance_test_basic.py Outdated Show resolved Hide resolved
tests/performance_tests/performance_test_basic.py Outdated Show resolved Hide resolved
tests/performance_tests/performance_test_basic.py Outdated Show resolved Hide resolved
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"))
Copy link
Contributor

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.

@ClaytonCalabrese ClaytonCalabrese merged commit 6dd154b into feature_performance_harness_stage_2 Jan 4, 2023
@ClaytonCalabrese ClaytonCalabrese deleted the performance_harness_replace_os_path branch January 4, 2023 18:35
@oschwaldp-oci oschwaldp-oci added the OCI Work exclusive to OCI team label Apr 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCI Work exclusive to OCI team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants