Skip to content

Conversation

@nertpinx
Copy link
Contributor

Few patches for things I found when trying to add tests for load_config().

Closes #345

@nertpinx
Copy link
Contributor Author

I marked this as a draft since I am not sure this is the proper way of contributing. Let me know if any changes are needed. Thanks.

@codecov
Copy link

codecov bot commented Sep 15, 2022

Codecov Report

Merging #1396 (0446cd1) into develop (b2b2a80) will decrease coverage by 0.93%.
The diff coverage is n/a.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1396      +/-   ##
===========================================
- Coverage    66.19%   65.26%   -0.94%     
===========================================
  Files           86       81       -5     
  Lines         9068     8767     -301     
===========================================
- Hits          6003     5722     -281     
+ Misses        3065     3045      -20     

setup.cfg Outdated
@@ -1,5 +1,5 @@
[metadata]
license_file = LICENSE.txt
license_files = LICENSE.txt
Copy link
Contributor

Choose a reason for hiding this comment

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

Why?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is explained in the commit message which is not immediately seen in GitHub, I can split it into a separate PR, just like the other unrelated patches.

8e9b8fc

Copy link
Contributor

Choose a reason for hiding this comment

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

It is good to keep PR’s within the narrowest scope as practical. Perhaps a quote by Einstein somewhat applies; “Everything should be made as simple as possible, but not simpler.” The review process is simpler (and often can occur quicker) if changes fall within a scope described in the related issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, I removed the other patches and will post them separately.

@j-c-cook
Copy link
Contributor

I marked this as a draft since I am not sure this is the proper way of contributing. Let me know if any changes are needed. Thanks.

Your contribution workflow looks good. Once you think this is ready to go in, mark it as ready for review.

You’ll need to format your code with the black package. First install the linters requirements, pip install -r requirements-lint.txt and then run black —verbose . in the root directory of python-can. This should auto format the 3 files that are causing the formatting check to break.

@nertpinx nertpinx marked this pull request as ready for review September 18, 2022 08:44
Also do not skip the test since there will always be an interface (previously
set globally and now prepared in setUp function.
Testing with the same interface values would not show possible issues in case
there were any.
Add tests for load_config with contexts and environment variables.

Closes hardbyte#345

Signed-off-by: Martin Kletzander <nert.pinx@gmail.com>
Copy link
Owner

@hardbyte hardbyte left a comment

Choose a reason for hiding this comment

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

Thanks for adding these tests (and your contributions across other PRs)

@zariiii9003 zariiii9003 merged commit a144f25 into hardbyte:develop Oct 7, 2022
@nertpinx nertpinx deleted the test_load_config branch October 10, 2022 14:39
j-c-cook added a commit to j-c-cook/python-can that referenced this pull request Nov 11, 2022
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.

Add tests for load_config()

4 participants