---
source: crates/ruff_linter/src/rules/flake8_pytest_style/mod.rs
---
PT003 [*] `scope='function'` is implied in `@pytest.fixture()`
  --> PT003.py:14:17
   |
14 | @pytest.fixture(scope="function")
   |                 ^^^^^^^^^^^^^^^^
15 | def error():
16 |     ...
   |
help: Remove implied `scope` argument
   |
13 |
   - @pytest.fixture(scope="function")
14 + @pytest.fixture()
15 | def error():
   |
note: This is an unsafe fix and may change runtime behavior

PT003 [*] `scope='function'` is implied in `@pytest.fixture()`
  --> PT003.py:19:17
   |
19 | @pytest.fixture(scope="function", name="my_fixture")
   |                 ^^^^^^^^^^^^^^^^
20 | def error_multiple_args():
21 |     ...
   |
help: Remove implied `scope` argument
   |
18 |
   - @pytest.fixture(scope="function", name="my_fixture")
19 + @pytest.fixture(name="my_fixture")
20 | def error_multiple_args():
   |
note: This is an unsafe fix and may change runtime behavior

PT003 [*] `scope='function'` is implied in `@pytest.fixture()`
  --> PT003.py:24:36
   |
24 | @pytest.fixture(name="my_fixture", scope="function")
   |                                    ^^^^^^^^^^^^^^^^
25 | def error_multiple_args():
26 |     ...
   |
help: Remove implied `scope` argument
   |
23 |
   - @pytest.fixture(name="my_fixture", scope="function")
24 + @pytest.fixture(name="my_fixture")
25 | def error_multiple_args():
   |
note: This is an unsafe fix and may change runtime behavior

PT003 [*] `scope='function'` is implied in `@pytest.fixture()`
  --> PT003.py:29:36
   |
29 | @pytest.fixture(name="my_fixture", scope="function", **kwargs)
   |                                    ^^^^^^^^^^^^^^^^
30 | def error_second_arg():
31 |     ...
   |
help: Remove implied `scope` argument
   |
28 |
   - @pytest.fixture(name="my_fixture", scope="function", **kwargs)
29 + @pytest.fixture(name="my_fixture", **kwargs)
30 | def error_second_arg():
   |
note: This is an unsafe fix and may change runtime behavior

PT003 [*] `scope='function'` is implied in `@pytest.fixture()`
  --> PT003.py:37:31
   |
35 | # tests the general case as we use a helper function that should
36 | # work for all cases.
37 | @pytest.fixture("my_fixture", scope="function")
   |                               ^^^^^^^^^^^^^^^^
38 | def error_arg():
39 |     ...
   |
help: Remove implied `scope` argument
   |
36 | # work for all cases.
   - @pytest.fixture("my_fixture", scope="function")
37 + @pytest.fixture("my_fixture")
38 | def error_arg():
   |
note: This is an unsafe fix and may change runtime behavior

PT003 [*] `scope='function'` is implied in `@pytest.fixture()`
  --> PT003.py:43:5
   |
42 | @pytest.fixture(
43 |     scope="function",
   |     ^^^^^^^^^^^^^^^^
44 |     name="my_fixture",
45 | )
   |
help: Remove implied `scope` argument
   |
42 | @pytest.fixture(
   -     scope="function",
43 |     name="my_fixture",
   |
note: This is an unsafe fix and may change runtime behavior

PT003 [*] `scope='function'` is implied in `@pytest.fixture()`
  --> PT003.py:52:5
   |
50 | @pytest.fixture(
51 |     name="my_fixture",
52 |     scope="function",
   |     ^^^^^^^^^^^^^^^^
53 | )
54 | def error_multiple_args():
   |
help: Remove implied `scope` argument
   |
51 |     name="my_fixture",
   -     scope="function",
52 | )
   |
note: This is an unsafe fix and may change runtime behavior

PT003 [*] `scope='function'` is implied in `@pytest.fixture()`
  --> PT003.py:66:5
   |
64 |       # another comment ,)
65 |       
66 | /     scope=\
67 | |         "function"  # some comment ),
   | |__________________^
68 |       ,
   |
help: Remove implied `scope` argument
   |
65 |     
   -     scope=\
   -         "function"  # some comment ),
   -     ,
   -     
66 |     name2=name, name3="my_fixture", **kwargs
   |
note: This is an unsafe fix and may change runtime behavior
