-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Make a code check which bans imports of fixtures in tests #30914
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
Comments
take |
There are some useful things that are imported from conftest.py that cannot be converted to a fixture. So "fixing" this should first discuss what to do instead (or where to move those) ? |
Good point @jorisvandenbossche I'll check the current violations and make a proposal here. |
Alright, so there are basically three types of cases:
|
for 1 the two PRs lgtm. agree with 2. for 3 could have the constants in a separate module as suggested (like token.py — Constants used with Python parse trees) and then import into testing.py (like tokenize.py — Tokenizer for Python source - All constants from the token module are also exported from tokenize) and then we could do say tm.UNSIGNED_INT_DTYPES |
* [#30914] Make a code check which bans imports of fixtures in tests * using indices fixture instead of duplicative index fixture * calling 'indices' fixture as 'index' * Revert "calling 'indices' fixture as 'index'" This reverts commit 1eba26d. * using string_index fixture instead of @pytest.mark.parametrize(indices, [string], indirect=True) * Revert "using string_index fixture instead of @pytest.mark.parametrize(indices, [string], indirect=True)" This reverts commit 2a3e611.
xref #30894 (comment)
Example: writing
in a test file should be disallowed because there exists the fixture
any_nullable_int_dtype
The text was updated successfully, but these errors were encountered: