-
Notifications
You must be signed in to change notification settings - Fork 2
Add comprehensive test suite infrastructure for numta #25
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -6,9 +6,12 @@ on: | |||||||
| pull_request: | ||||||||
| branches: [ main ] | ||||||||
|
|
||||||||
| permissions: | ||||||||
| contents: read | ||||||||
|
|
||||||||
| jobs: | ||||||||
| test: | ||||||||
| name: Test on Python ${{ matrix.python-version }} | ||||||||
| name: Unit Tests (Python ${{ matrix.python-version }}) | ||||||||
| runs-on: ubuntu-latest | ||||||||
| strategy: | ||||||||
| fail-fast: false | ||||||||
|
|
@@ -30,9 +33,46 @@ jobs: | |||||||
| python -m pip install --upgrade pip | ||||||||
| pip install -e ".[dev]" | ||||||||
|
|
||||||||
| - name: Run tests | ||||||||
| - name: Run unit tests | ||||||||
| run: | | ||||||||
| pytest -v --ignore=tests/accuracy --ignore=tests/benchmark -x | ||||||||
|
|
||||||||
| - name: Run tests with coverage | ||||||||
| if: matrix.python-version == '3.12' | ||||||||
| run: | | ||||||||
| pip install pytest-cov | ||||||||
| pytest --cov=numta --cov-report=xml --ignore=tests/accuracy --ignore=tests/benchmark | ||||||||
|
|
||||||||
| - name: Upload coverage reports | ||||||||
| if: matrix.python-version == '3.12' | ||||||||
| uses: codecov/codecov-action@v4 | ||||||||
| with: | ||||||||
| files: ./coverage.xml | ||||||||
| fail_ci_if_error: false | ||||||||
|
||||||||
| fail_ci_if_error: false | |
| fail_ci_if_error: false | |
| token: ${{ secrets.CODECOV_TOKEN }} |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -35,6 +35,7 @@ dependencies = [ | |||||
| dev = [ | ||||||
| "pytest>=7.0.0", | ||||||
| "pytest-benchmark>=4.0.0", | ||||||
| "pytest-cov>=4.0.0", | ||||||
| "pandas>=1.3.0", | ||||||
| ] | ||||||
| pandas = [ | ||||||
|
|
@@ -79,3 +80,33 @@ testpaths = ["tests"] | |||||
| python_files = ["test_*.py"] | ||||||
| python_classes = ["Test*"] | ||||||
| python_functions = ["test_*"] | ||||||
| markers = [ | ||||||
| "numba: marks tests requiring numba", | ||||||
| "pandas: marks tests requiring pandas", | ||||||
| "talib: marks tests requiring TA-Lib", | ||||||
| "pandas_ta: marks tests requiring pandas-ta", | ||||||
| "slow: marks tests as slow", | ||||||
| "benchmark: marks tests as benchmark tests", | ||||||
| ] | ||||||
| filterwarnings = [ | ||||||
| "ignore::DeprecationWarning", | ||||||
| "ignore::PendingDeprecationWarning", | ||||||
| ] | ||||||
|
|
||||||
| [tool.coverage.run] | ||||||
| source = ["src/numta"] | ||||||
| branch = true | ||||||
| omit = [ | ||||||
| "*/tests/*", | ||||||
| "*/_version.py", | ||||||
| ] | ||||||
|
|
||||||
| [tool.coverage.report] | ||||||
| exclude_lines = [ | ||||||
| "pragma: no cover", | ||||||
| "def __repr__", | ||||||
| "raise NotImplementedError", | ||||||
| "if TYPE_CHECKING:", | ||||||
| "if __name__ == .__main__.:", | ||||||
|
||||||
| "if __name__ == .__main__.:", | |
| "if __name__ == \"__main__\":", |
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.
The
pytest-covpackage is already added to thedevdependencies at line 38, so thepip install pytest-covcommand in the workflow is redundant. The package should already be installed from thepip install -e ".[dev]"step on line 34.