PD-97 Add unit test to check CLI/pypfb import#285
Conversation
|
The style in this PR agrees with This formatting comment was generated automatically by a script in uc-cdis/wool. |
Update test_cli to assert SystemExit 0
4d49336 to
740fc20
Compare
8c51895 to
befad2b
Compare
| import pytest | ||
|
|
||
|
|
||
| def test_import_cli(monkeypatch): |
There was a problem hiding this comment.
| def test_import_cli(monkeypatch): | |
| def test_import_cli(monkeypatch): | |
| """ | |
| Test that invoking the help from the CLI does not return an error | |
| """ |
| # Load plug-ins from entry_points (syntax changes for python 3.12+) | ||
| major = sys.version_info[0] | ||
| minor = sys.version_info[1] | ||
| if major == 3 and minor >= 12: |
There was a problem hiding this comment.
I would much rather try/catch than explicitly name major and minor versions in the code, but I don't feel super strongly about it. It's just that if in the long long future Python releases a 4 major, this is going to break again.
gen3/utils.py
Outdated
| for ep in entry_points(group="pfb.plugins"): | ||
| ep.load() | ||
| else: | ||
| for ep in entry_points().get("pfb.plugins", []): | ||
| ep.load() |
There was a problem hiding this comment.
i didn't look into how this works exactly, but it looks off to me that it's hardcoded to pfb.plugins here and called in both gen3/cli/pfb.py and gen3/cli/users.py
There was a problem hiding this comment.
Fixed. It should be gen3.plugins not pfb.plugins. Thanks for catching the copy paste error
|
Failed to Prepare CI environment Please find the Github Action logs here |
Regression test for:
Link to JIRA ticket if there is one: https://ctds-planx.atlassian.net/browse/PD-97
New Features
Breaking Changes
Bug Fixes
Improvements
Dependency updates
Deployment changes