Skip to content

Conversation

@dingo4dev
Copy link
Contributor

Rationale for this change

Add testpaths option to enjoy the Test Explorer UI extension in development. Without this option, though the Python Test Adpater Log will run pytest --collect-only to discovery tests, it will potential occur error when parsing the test files (e.g. Import Error).


Results:

Before adding testpaths After adding testpaths
image image

After adding testpaths:

Are these changes tested?

Yes, Tested on Codespace and local VScode

Are there any user-facing changes?

No, this change not affect any iceberg code.

Add `testpaths` option to enjoy the Test Explorer UI extension in development.
Without this option, though the Python Test Adpater Log will run `pytest --collect-only` to discovery tests, it will potential occur error when parsing the test files (e.g. Import Error).
Copilot AI review requested due to automatic review settings July 10, 2025 09:08
Copy link
Contributor

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 adds the testpaths option to the pytest configuration to scope test discovery to the tests directory, preventing import errors in the Test Explorer UI.

  • Specify testpaths = ["tests"] under [tool.pytest.ini_options] in pyproject.toml

@dingo4dev dingo4dev changed the title chore: specify test paths in pytest configuration chore: specify test paths to integrate with vscode testing extension Jul 10, 2025
Copy link
Contributor

@kevinjqliu kevinjqliu left a comment

Choose a reason for hiding this comment

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

Make sense, LGTM

this is the pytest docs for testpaths
https://docs.pytest.org/en/7.1.x/reference/reference.html#confval-testpaths

@kevinjqliu kevinjqliu merged commit dc43940 into apache:main Jul 10, 2025
10 checks passed
@dingo4dev dingo4dev deleted the test-explorer-vscode-integration branch July 10, 2025 17:28
@dingo4dev
Copy link
Contributor Author

@kevinjqliu Thanks for your review! 🚀

gabeiglio pushed a commit to Netflix/iceberg-python that referenced this pull request Aug 13, 2025
…pache#2194)

# Rationale for this change

Add `testpaths` option to enjoy the Test Explorer UI extension in
development. Without this option, though the Python Test Adpater Log
will run `pytest --collect-only` to discovery tests, it will potential
occur error when parsing the test files (e.g. Import Error).

---
## Results:
| Before adding `testpaths`  | After adding `testpaths` |
|------------------------------|---------------------------|
|
![image](https://github.com/user-attachments/assets/bbee6269-7e96-4a4a-a838-3be283260f6a)|
![image](https://github.com/user-attachments/assets/210eabbd-12ea-4d70-b71e-a9d47a25d828)|

After adding `testpaths`:


# Are these changes tested?

Yes, Tested on Codespace and local VScode

# Are there any user-facing changes?

No, this change not affect any iceberg code.
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.

2 participants