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

Fix UT test_BlockUseSwsssdk() #128

Merged
merged 4 commits into from
Nov 10, 2022

Conversation

liuh-80
Copy link
Contributor

@liuh-80 liuh-80 commented Nov 1, 2022

Why I did it

Fix this issue: sonic-net/sonic-buildimage#12558
UT failed under python2: test_BlockUseSwsssdk()

  result = subprocess.run(["python", "-c", "import swsssdk;exit()"], capture_output=True, cwd=swsssdk_path)

E AttributeError: 'module' object has no attribute 'run'

How I did it

Update UT to use subprocess.check_output(), which support by both python3 and python2.

How to verify it

Pass all UT.

Which release branch to backport (provide reason below if selected)

Description for the changelog

Fix UT test_BlockUseSwsssdk()

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

@liuh-80 liuh-80 marked this pull request as ready for review November 2, 2022 00:21
@liuh-80 liuh-80 requested a review from qiluo-msft November 2, 2022 00:21
@liuh-80
Copy link
Contributor Author

liuh-80 commented Nov 2, 2022

Tested with this PR: sonic-net/sonic-buildimage#12565

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants