-
Notifications
You must be signed in to change notification settings - Fork 9
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 test failures on main #82
Conversation
Out test cases were falling over when cats printed newlines which were unexpected in the test cases. This puts the newlines in the expected strings in the tests.
bee9ee8
to
407d0b7
Compare
eror -> error, mypy picks this up
Always return an integer from main (so we sys.exit 0 if everything works). Don't reuse output for the subrocess output (bytes) and the cats output type that goes into the subprocess.
The return type now matches what we return, but could probably use some cleanup. We don't make use of the returned _jobinfo and _PUE but we probably should. We pull out jobinfo below in main. We probably shouldn't.
But I cannot help but think that this is a long way around. Unwrapping the dictonary construtor so that mypy can see the types (aroud line 32) seems more complex than it should be, and the cast at the end seems painful. Can we not just build the TypedDict as we go?
This will help us keep track of current test coverage
Hi @andreww - I split the rewriting/testing of the carbon footprint estimation module into two PR #79 and #80. I just merged #80 in which fixed the failing test on |
@@ -24,7 +24,8 @@ | |||
__all__ = ["get_runtime_config"] | |||
|
|||
|
|||
def get_runtime_config(args) -> tuple[dict, APIInterface, str, int]: | |||
def get_runtime_config(args) -> tuple[Mapping[str, Any], APIInterface, str, int, | |||
Union[list[tuple[int, float]],None],Any]: |
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.
one of these cases where typing really isn't worth the trouble in my opinion.
About the conflicts:
|
Thanks - I'll reorder and rebase this branch so that it makes sense now #80 is merged. |
Rebased and cleaned all of this up. Two new PRs inbound. We can kill this one. |
This fixes two (of the three) failing tests on main.
The issues that are fixed involves a test case where newlines are printed by cats, which are not in the reference output in the tests (an easy fix).