-
Notifications
You must be signed in to change notification settings - Fork 45
[ENH] isolate lookup tests to dedicated mock package #476
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
Open
arnavk23
wants to merge
40
commits into
sktime:main
Choose a base branch
from
arnavk23:fix/issue-114-restrict-lookup-tests
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 27 commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
37150eb
ENH: add regression test for HTML repr of meta-objects (fixes #163)
arnavk23 b0ce58c
ENH: add test for all_objects tag filtering (regression for #161/#162)
arnavk23 b06f1fb
Delete skbase/base/_pretty_printing/tests/test_object_html_repr.py
arnavk23 b5c9c06
STYLE: wrap long docstring to satisfy flake8 E501
arnavk23 72a688c
tests(lookup): restrict package_name to skbase.tests to reduce scan s…
arnavk23 ef2a3de
tests(lookup): use dedicated mock_package fixtures; add fixtures and …
arnavk23 9dd4cd9
tests(mock_package): add public module, private module, and subpackag…
arnavk23 15b7935
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] d670fa2
style(tests): fix indentation (replace tabs with spaces) in mock_pack…
arnavk23 95db0d0
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 08054cb
tests(mock_package): remove old files renamed to test_* counterparts
arnavk23 cfc4d14
correcting test file names
arnavk23 6e00981
fixing tags
arnavk23 0174af9
Fix flake8 B043 error: use variable for delattr attribute name
arnavk23 cea639d
Add arnavk23 (Arnav Kapoor) to contributors list
arnavk23 d36b14a
actual representation against the expected representation
arnavk23 a3f25fe
Fix test_get_package_metadata: remove imported classes from __all__ i…
arnavk23 5467010
Fix flake8 F401: add noqa comments for re-exported classes in mock_pa…
arnavk23 3a45ea6
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 0d901dc
Merge branch 'main' into fix/issue-114-restrict-lookup-tests
arnavk23 31fcf6d
Merge branch 'main' into pr/476
fkiraly fac3d04
Update test_base.py
fkiraly 20a572b
Merge branch 'main' into fix/issue-114-restrict-lookup-tests
arnavk23 a8946f8
Merge branch 'main' into fix/issue-114-restrict-lookup-tests
arnavk23 a1a97cb
Merge branch 'main' into fix/issue-114-restrict-lookup-tests
arnavk23 36e61c3
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] b088695
Merge branch 'main' into fix/issue-114-restrict-lookup-tests
arnavk23 c86f4e4
removal of tests that are not relevant to the lookup tests, and to re…
arnavk23 3b74e86
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 46e0a8b
flake8
arnavk23 dc489fd
Merge branch 'main' into fix/issue-114-restrict-lookup-tests
arnavk23 e3e889e
Update test_lookup.py
arnavk23 acc90cd
Update .all-contributorsrc
arnavk23 188b76a
adding changes
arnavk23 e0cab6c
Merge branch 'main' into pr/476
fkiraly bd77634
added private class and function to mock package and added tests for …
arnavk23 b675afa
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 69d395a
pre-commit
arnavk23 7761319
Merge branch 'fix/issue-114-restrict-lookup-tests' of https://www.git…
arnavk23 81bd3f9
Merge branch 'main' into fix/issue-114-restrict-lookup-tests
arnavk23 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| """Subpackage in mock package to test recursive walking.""" | ||
|
|
||
| __all__ = ["test_module_b"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| # -*- coding: utf-8 -*- | ||
| """Module inside subpackage to test recursive discovery.""" | ||
|
|
||
|
|
||
| def subpkg_fn(): | ||
| """Return the string "ok" to indicate functionality.""" | ||
| return "ok" | ||
|
|
||
|
|
||
| __all__ = ["subpkg_fn"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| # -*- coding: utf-8 -*- | ||
| """Additional fixture classes for the mock package used in lookup tests.""" | ||
|
|
||
| from typing import List | ||
|
|
||
| from skbase.base import BaseObject | ||
|
|
||
| __author__: List[str] = ["fkiraly", "RNKuhns"] | ||
|
|
||
|
|
||
| class Parent(BaseObject): | ||
| """Parent class to test tag inheritance and class filters.""" | ||
|
|
||
| _tags = {"A": "1", "B": 2, "C": 1234, "3": "D"} | ||
|
|
||
| def __init__(self, a="something", b=7, c=None): | ||
| """Initialize the fixture with simple attributes.""" | ||
| self.a = a | ||
| self.b = b | ||
| self.c = c | ||
| super().__init__() | ||
|
|
||
| def some_method(self): | ||
| """Placeholder method used in tests.""" | ||
| pass | ||
|
|
||
|
|
||
| class Child(Parent): | ||
| """Child class that overrides some tags.""" | ||
|
|
||
| _tags = {"A": 42, "3": "E"} | ||
| __author__ = ["fkiraly", "RNKuhns"] | ||
|
|
||
| def some_method(self): | ||
| """Child placeholder method used in tests.""" | ||
| pass | ||
|
|
||
|
|
||
| class ClassWithABTrue(Parent): | ||
| """Child class that sets A and B tags to True.""" | ||
|
|
||
| _tags = {"A": True, "B": True} | ||
| __author__ = ["fkiraly", "RNKuhns"] | ||
|
|
||
| def some_method(self): | ||
| """Placeholder method used in tests.""" | ||
| pass | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| # -*- coding: utf-8 -*- | ||
| """Public module in mock package with decorated and plain functions.""" | ||
|
|
||
| from functools import wraps | ||
|
|
||
|
|
||
| def simple_function(x): | ||
| """Double the given input and return the result.""" | ||
| return x * 2 | ||
|
|
||
|
|
||
| def my_decorator(func): | ||
| @wraps(func) | ||
| def wrapper(*args, **kwargs): | ||
| return func(*args, **kwargs) | ||
|
|
||
| return wrapper | ||
|
|
||
|
|
||
| @my_decorator | ||
| def decorated_function(y): | ||
| """Increment the given input by one and return the result.""" | ||
| return y + 1 | ||
|
|
||
|
|
||
| __all__ = ["simple_function", "decorated_function"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| # -*- coding: utf-8 -*- | ||
| """Non-public module in mock package; contains a non-public BaseObject subclass. | ||
|
|
||
| This module's class name begins with an underscore and should be ignored by | ||
| `all_objects` when `exclude_non_public_items` is True. | ||
| """ | ||
|
|
||
| from skbase.base import BaseObject | ||
|
|
||
|
|
||
| class _PrivateThing(BaseObject): | ||
| """A non-public BaseObject subclass that should be ignored by discovery.""" | ||
|
|
||
| def __init__(self): | ||
| super().__init__() | ||
|
|
||
|
|
||
| __all__ = ["_PrivateThing"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check warning
Code scanning / CodeQL
`__eq__` not overridden when adding attributes Warning test