aboutcode-org / aboutcode-org/skeleton

Configuring pytest to pick up "*.py" accidentally pulls in setup.py

Đang mở
#88 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
9
Fork
9
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

As noted in NexB/saneyaml#15, the `pytest` configuration in `pyproject.toml` currently configures it to pick up `*.py`:

https://github.com/nexB/skeleton/blob/acf94b360d675087195b7f216f4bee4401609729/pyproject.toml#L10
https://github.com/nexB/skeleton/blob/acf94b360d675087195b7f216f4bee4401609729/pyproject.toml#L43

This causes it to pick up the `setup.py` file as a potential test file, and even though it will contain no tests, importing `setup.py` during testing can have unwanted side effects. (For one, it makes `setuptools` a dependency of the test environment, where it would otherwise normally not be.)

Unfortunately, reading through [the pytest documentation](https://docs.pytest.org/en/8.2.x/reference/reference.html#ini-options-ref), it doesn't seem as though there's an easy way to exclude specific files once they've been caught up in an inclusion glob.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.