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

Add pytest conftest #158

Merged
merged 1 commit into from
Oct 28, 2022
Merged

Add pytest conftest #158

merged 1 commit into from
Oct 28, 2022

Conversation

amirhessam88
Copy link
Member

@amirhessam88 amirhessam88 commented Oct 28, 2022

Description

  • Added conftest.py and move all pytest.fixtures in it.
  • Fixed some warnings in glmnet tests.
  • Consolidated test/utils.py into conftest.py.
  • More cleanups.

Resolves: #issue-number-here

Pull Request Checklist

  • Added tests for added or changed code.
  • Added documentation for changed code.

from tests import resources


@pytest.fixture(scope="session")
Copy link
Member Author

Choose a reason for hiding this comment

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

all fixtures should have session scope.



# TODO(amir): add lolipop plot for coeff + unit-test
# TODO(amir): add test for lambda-path param
class TestGLMNetCVClassifier:
"""Validates `GLMNetCVClassifier` instantiation."""

@staticmethod
@pytest.fixture(scope="module")
Copy link
Member Author

Choose a reason for hiding this comment

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

all repeated fixture codes are now removed.

@@ -1,151 +0,0 @@
import importlib.resources as pkg_resources
Copy link
Member Author

Choose a reason for hiding this comment

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

the content of utils.py are now consolidated with conftest.py.

ids=_ids,
)
def test_xgboostcvregressor__passes__with_defaults(
self,
reg_x_y_data: Tuple[
reg_train_test_x_y: Tuple[
Copy link
Member Author

Choose a reason for hiding this comment

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

standardized the naming conventions.

@amirhessam88 amirhessam88 merged commit 485b4b6 into master Oct 28, 2022
@amirhessam88 amirhessam88 deleted the amir/conftest branch October 28, 2022 03:36
@amirhessam88 amirhessam88 self-assigned this Dec 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant