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

testdata: Don't modify keys while iterating #42

Merged
merged 2 commits into from
Feb 24, 2021

Conversation

jpsamaroo
Copy link

I ran into errors like RuntimeError: dictionary keys changed during iteration during testing; this fixes those for me.

@coveralls
Copy link

coveralls commented Oct 28, 2020

Coverage Status

Coverage remained the same at 96.049% when pulling 0112552 on jpsamaroo:jps/fix-testdata-iteration into 5b57636 on iovisor:master.

@@ -45,15 +45,18 @@ def read(name):


# Resolve links
_data = {}
for k in data:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't we use list() here to make a copy of the keys?

Suggested change
for k in data:
for k in list(data):

@jpsamaroo
Copy link
Author

2.7 tests are passing on my Travis account, but 3.5 tests are failing for unrelated reasons: https://travis-ci.com/github/jpsamaroo/ubpf/builds/213806623

Copy link
Collaborator

@pchaigno pchaigno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

We'll resolve the failing tests in another PR.

@pchaigno pchaigno merged commit 9f9d051 into iovisor:master Feb 24, 2021
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.

3 participants