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

format & lint – cg/tests/*.py #614

Merged
merged 7 commits into from Oct 30, 2023
Merged

Conversation

jGaboardi
Copy link
Member

@jGaboardi jGaboardi commented Oct 30, 2023

xref #589

This PR formats & lints cg/tests/*.py, wrapping up the libpysa/cg module.

@jGaboardi jGaboardi self-assigned this Oct 30, 2023
@jGaboardi jGaboardi changed the title format & lint – cg/tests*.py format & lint – cg/tests/*.py Oct 30, 2023
libpysal/cg/tests/test_geoJSON.py Outdated Show resolved Hide resolved
libpysal/cg/tests/test_geoJSON.py Outdated Show resolved Hide resolved
libpysal/cg/tests/test_shapes.py Outdated Show resolved Hide resolved
libpysal/cg/tests/test_shapes.py Outdated Show resolved Hide resolved
libpysal/cg/tests/test_shapes.py Outdated Show resolved Hide resolved
libpysal/cg/tests/test_shapes.py Outdated Show resolved Hide resolved
@jGaboardi
Copy link
Member Author

@martinfleis How do we want to handle all these cases of declared variables not being used in tests? Shall I update with your _ = UNUSED suggestion?

@martinfleis
Copy link
Member

Depends. If they're not doing anything, I'd remove the whole line. If they do but we are not interested in what they return, then assigning to _ is a common pattern. The issue is that for most of these I don't know if they modify some variable used later in some way or not.

@jGaboardi
Copy link
Member Author

Depends. If they're not doing anything, I'd remove the whole line. If they do but we are not interested in what they return, then assigning to _ is a common pattern. The issue is that for most of these I don't know if they modify some variable used later in some way or not.

Yeah, seems like most are simply doing checks, so the _ would be appropriate. I'll see about all of them though.

@martinfleis
Copy link
Member

Yeah, it could just be a check to ensure there's no error. Then assigning to _ should be fine for ruff?

@jGaboardi
Copy link
Member Author

Yeah, it could just be a check to ensure there's no error. Then assigning to _ should be fine for ruff?

Yep, that's what I did for those and ruff liked it.

@jGaboardi
Copy link
Member Author

This is good for review, by the way.

libpysal/cg/tests/test_ashapes.py Outdated Show resolved Hide resolved
libpysal/cg/tests/test_geoJSON.py Show resolved Hide resolved
@jGaboardi jGaboardi merged commit e76cce3 into pysal:main Oct 30, 2023
7 of 8 checks passed
@jGaboardi jGaboardi deleted the lint_cg_tests branch October 30, 2023 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants