aboutcode-org / aboutcode-org/skeleton

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

オープン
#88 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
9
フォーク
9
PR マージ指標
30日以内にマージされた PR はありません

説明

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.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。