|
9 | 9 | in case of warnings which need to format their messages. |
10 | 10 | """ |
11 | 11 | from _pytest.warning_types import PytestDeprecationWarning |
12 | | -from _pytest.warning_types import RemovedInPytest4Warning |
13 | | -from _pytest.warning_types import UnformattedWarning |
14 | | - |
15 | | -YIELD_TESTS = "yield tests were removed in pytest 4.0 - {name} will be ignored" |
16 | 12 |
|
17 | 13 | # set of plugins which have been integrated into the core; we use this list to ignore |
18 | 14 | # them during registration to avoid conflicts |
|
23 | 19 | } |
24 | 20 |
|
25 | 21 |
|
26 | | -FIXTURE_FUNCTION_CALL = ( |
27 | | - 'Fixture "{name}" called directly. Fixtures are not meant to be called directly,\n' |
28 | | - "but are created automatically when test functions request them as parameters.\n" |
29 | | - "See https://docs.pytest.org/en/latest/fixture.html for more information about fixtures, and\n" |
30 | | - "https://docs.pytest.org/en/latest/deprecations.html#calling-fixtures-directly about how to update your code." |
31 | | -) |
32 | | - |
33 | | -FIXTURE_NAMED_REQUEST = PytestDeprecationWarning( |
34 | | - "'request' is a reserved name for fixtures and will raise an error in future versions" |
35 | | -) |
36 | | - |
37 | | -CFG_PYTEST_SECTION = "[pytest] section in {filename} files is no longer supported, change to [tool:pytest] instead." |
38 | | - |
39 | | -GETFUNCARGVALUE = RemovedInPytest4Warning( |
40 | | - "getfuncargvalue is deprecated, use getfixturevalue" |
41 | | -) |
42 | | - |
43 | 22 | FUNCARGNAMES = PytestDeprecationWarning( |
44 | 23 | "The `funcargnames` attribute was an alias for `fixturenames`, " |
45 | 24 | "since pytest 2.3 - use the newer attribute instead." |
46 | 25 | ) |
47 | 26 |
|
48 | | -RAISES_MESSAGE_PARAMETER = PytestDeprecationWarning( |
49 | | - "The 'message' parameter is deprecated.\n" |
50 | | - "(did you mean to use `match='some regex'` to check the exception message?)\n" |
51 | | - "Please see:\n" |
52 | | - " https://docs.pytest.org/en/4.6-maintenance/deprecations.html#message-parameter-of-pytest-raises" |
53 | | -) |
54 | 27 |
|
55 | 28 | RESULT_LOG = PytestDeprecationWarning( |
56 | 29 | "--result-log is deprecated and scheduled for removal in pytest 6.0.\n" |
57 | 30 | "See https://docs.pytest.org/en/latest/deprecations.html#result-log-result-log for more information." |
58 | 31 | ) |
59 | | - |
60 | | -RAISES_EXEC = PytestDeprecationWarning( |
61 | | - "raises(..., 'code(as_a_string)') is deprecated, use the context manager form or use `exec()` directly\n\n" |
62 | | - "See https://docs.pytest.org/en/latest/deprecations.html#raises-warns-exec" |
63 | | -) |
64 | | -WARNS_EXEC = PytestDeprecationWarning( |
65 | | - "warns(..., 'code(as_a_string)') is deprecated, use the context manager form or use `exec()` directly.\n\n" |
66 | | - "See https://docs.pytest.org/en/latest/deprecations.html#raises-warns-exec" |
67 | | -) |
68 | | - |
69 | | -PYTEST_PLUGINS_FROM_NON_TOP_LEVEL_CONFTEST = ( |
70 | | - "Defining 'pytest_plugins' in a non-top-level conftest is no longer supported " |
71 | | - "because it affects the entire directory tree in a non-explicit way.\n" |
72 | | - " {}\n" |
73 | | - "Please move it to a top level conftest file at the rootdir:\n" |
74 | | - " {}\n" |
75 | | - "For more information, visit:\n" |
76 | | - " https://docs.pytest.org/en/latest/deprecations.html#pytest-plugins-in-non-top-level-conftest-files" |
77 | | -) |
78 | | - |
79 | | -PYTEST_CONFIG_GLOBAL = PytestDeprecationWarning( |
80 | | - "the `pytest.config` global is deprecated. Please use `request.config` " |
81 | | - "or `pytest_configure` (if you're a pytest plugin) instead." |
82 | | -) |
83 | | - |
84 | | -PYTEST_ENSURETEMP = RemovedInPytest4Warning( |
85 | | - "pytest/tmpdir_factory.ensuretemp is deprecated, \n" |
86 | | - "please use the tmp_path fixture or tmp_path_factory.mktemp" |
87 | | -) |
88 | | - |
89 | | -PYTEST_LOGWARNING = PytestDeprecationWarning( |
90 | | - "pytest_logwarning is deprecated, no longer being called, and will be removed soon\n" |
91 | | - "please use pytest_warning_captured instead" |
92 | | -) |
93 | | - |
94 | | -PYTEST_WARNS_UNKNOWN_KWARGS = UnformattedWarning( |
95 | | - PytestDeprecationWarning, |
96 | | - "pytest.warns() got unexpected keyword arguments: {args!r}.\n" |
97 | | - "This will be an error in future versions.", |
98 | | -) |
99 | | - |
100 | | -PYTEST_PARAM_UNKNOWN_KWARGS = UnformattedWarning( |
101 | | - PytestDeprecationWarning, |
102 | | - "pytest.param() got unexpected keyword arguments: {args!r}.\n" |
103 | | - "This will be an error in future versions.", |
104 | | -) |
0 commit comments