Skip to content

Fix tests#15

Open
mcocdawc wants to merge 2 commits intodevelopfrom
fix_tests
Open

Fix tests#15
mcocdawc wants to merge 2 commits intodevelopfrom
fix_tests

Conversation

@mcocdawc
Copy link
Copy Markdown

Description

Fixes the testsuite.
Before it failed when doing

pip install .
pytest

only an editable install, i.e.

pip install -e .
pytest

worked.

Contributor Declaration

By opening this pull request, I affirm the following:

  • All authors agree to the Contributor License Agreement.
  • The code follows the project's coding standards.
  • I have performed self-review and added comments where needed.
  • I have added or updated tests to verify that my changes are effective and functional.
  • I have run all existing tests and confirmed they pass.

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.57%. Comparing base (ee199f1) to head (376e10f).

Additional details and impacted files
@@             Coverage Diff              @@
##           develop      #15       +/-   ##
============================================
+ Coverage    61.33%   99.57%   +38.23%     
============================================
  Files           24       11       -13     
  Lines         1239      467      -772     
============================================
- Hits           760      465      -295     
+ Misses         479        2      -477     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to make the test suite pass when running against a non-editable installation (pip install . followed by pytest), by adjusting import behavior and pytest collection settings.

Changes:

  • Switched some intra-package imports from relative to absolute earthkit.time.* imports.
  • Updated pytest configuration to only collect tests from tests/ (no longer from src/).
  • Disabled --doctest-modules in the default pytest options.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/earthkit/time/sequence.py Changes calendar import to an absolute earthkit.time.* import.
src/earthkit/time/climatology.py Changes imports of sequence/utilities to absolute earthkit.time.* imports.
pyproject.toml Alters pytest collection (removes src from testpaths) and disables doctest execution.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

testpaths = [
"src",
"tests",
]
from typing import Container, Dict, Iterable, Iterator, Optional, Tuple, Type, Union

from .calendar import (
from earthkit.time.calendar import (
Comment on lines +7 to +8
from earthkit.time.sequence import Sequence, YearlySequence
from earthkit.time.utilities import merge_sorted
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.

3 participants