|
1 | 1 | import os |
2 | 2 |
|
3 | | -from .helpers import TEST_DATA_PATH, find_test_line_number, get_absolute_test_id |
| 3 | +from .helpers import ( |
| 4 | + TEST_DATA_PATH, |
| 5 | + find_class_line_number, |
| 6 | + find_test_line_number, |
| 7 | + get_absolute_test_id, |
| 8 | +) |
4 | 9 |
|
5 | 10 | # This file contains the expected output dictionaries for tests discovery and is used in test_discovery.py. |
6 | 11 |
|
|
95 | 100 | "unittest_pytest_same_file.py::TestExample", |
96 | 101 | unit_pytest_same_file_path, |
97 | 102 | ), |
| 103 | + "lineno": find_class_line_number( |
| 104 | + "TestExample", unit_pytest_same_file_path |
| 105 | + ), |
98 | 106 | }, |
99 | 107 | { |
100 | 108 | "name": "test_true_pytest", |
|
207 | 215 | "unittest_folder/test_add.py::TestAddFunction", |
208 | 216 | test_add_path, |
209 | 217 | ), |
| 218 | + "lineno": find_class_line_number( |
| 219 | + "TestAddFunction", test_add_path |
| 220 | + ), |
210 | 221 | }, |
211 | 222 | { |
212 | 223 | "name": "TestDuplicateFunction", |
|
235 | 246 | "unittest_folder/test_add.py::TestDuplicateFunction", |
236 | 247 | test_add_path, |
237 | 248 | ), |
| 249 | + "lineno": find_class_line_number( |
| 250 | + "TestDuplicateFunction", test_add_path |
| 251 | + ), |
238 | 252 | }, |
239 | 253 | ], |
240 | 254 | }, |
|
288 | 302 | "unittest_folder/test_subtract.py::TestSubtractFunction", |
289 | 303 | test_subtract_path, |
290 | 304 | ), |
| 305 | + "lineno": find_class_line_number( |
| 306 | + "TestSubtractFunction", test_subtract_path |
| 307 | + ), |
291 | 308 | }, |
292 | 309 | { |
293 | 310 | "name": "TestDuplicateFunction", |
|
316 | 333 | "unittest_folder/test_subtract.py::TestDuplicateFunction", |
317 | 334 | test_subtract_path, |
318 | 335 | ), |
| 336 | + "lineno": find_class_line_number( |
| 337 | + "TestDuplicateFunction", test_subtract_path |
| 338 | + ), |
319 | 339 | }, |
320 | 340 | ], |
321 | 341 | }, |
|
553 | 573 | "parametrize_tests.py::TestClass", |
554 | 574 | parameterize_tests_path, |
555 | 575 | ), |
| 576 | + "lineno": find_class_line_number( |
| 577 | + "TestClass", parameterize_tests_path |
| 578 | + ), |
556 | 579 | "children": [ |
557 | 580 | { |
558 | 581 | "name": "test_adding", |
|
929 | 952 | "test_multi_class_nest.py::TestFirstClass", |
930 | 953 | TEST_MULTI_CLASS_NEST_PATH, |
931 | 954 | ), |
| 955 | + "lineno": find_class_line_number( |
| 956 | + "TestFirstClass", TEST_MULTI_CLASS_NEST_PATH |
| 957 | + ), |
932 | 958 | "children": [ |
933 | 959 | { |
934 | 960 | "name": "TestSecondClass", |
|
938 | 964 | "test_multi_class_nest.py::TestFirstClass::TestSecondClass", |
939 | 965 | TEST_MULTI_CLASS_NEST_PATH, |
940 | 966 | ), |
| 967 | + "lineno": find_class_line_number( |
| 968 | + "TestSecondClass", TEST_MULTI_CLASS_NEST_PATH |
| 969 | + ), |
941 | 970 | "children": [ |
942 | 971 | { |
943 | 972 | "name": "test_second", |
|
982 | 1011 | "test_multi_class_nest.py::TestFirstClass::TestSecondClass2", |
983 | 1012 | TEST_MULTI_CLASS_NEST_PATH, |
984 | 1013 | ), |
| 1014 | + "lineno": find_class_line_number( |
| 1015 | + "TestSecondClass2", TEST_MULTI_CLASS_NEST_PATH |
| 1016 | + ), |
985 | 1017 | "children": [ |
986 | 1018 | { |
987 | 1019 | "name": "test_second2", |
|
1227 | 1259 | "same_function_new_class_param.py::TestNotEmpty", |
1228 | 1260 | TEST_DATA_PATH / "same_function_new_class_param.py", |
1229 | 1261 | ), |
| 1262 | + "lineno": find_class_line_number( |
| 1263 | + "TestNotEmpty", TEST_DATA_PATH / "same_function_new_class_param.py" |
| 1264 | + ), |
1230 | 1265 | }, |
1231 | 1266 | { |
1232 | 1267 | "name": "TestEmpty", |
|
1298 | 1333 | "same_function_new_class_param.py::TestEmpty", |
1299 | 1334 | TEST_DATA_PATH / "same_function_new_class_param.py", |
1300 | 1335 | ), |
| 1336 | + "lineno": find_class_line_number( |
| 1337 | + "TestEmpty", TEST_DATA_PATH / "same_function_new_class_param.py" |
| 1338 | + ), |
1301 | 1339 | }, |
1302 | 1340 | ], |
1303 | 1341 | } |
|
1371 | 1409 | "test_param_span_class.py::TestClass1", |
1372 | 1410 | TEST_DATA_PATH / "test_param_span_class.py", |
1373 | 1411 | ), |
| 1412 | + "lineno": find_class_line_number( |
| 1413 | + "TestClass1", TEST_DATA_PATH / "test_param_span_class.py" |
| 1414 | + ), |
1374 | 1415 | }, |
1375 | 1416 | { |
1376 | 1417 | "name": "TestClass2", |
|
1427 | 1468 | "test_param_span_class.py::TestClass2", |
1428 | 1469 | TEST_DATA_PATH / "test_param_span_class.py", |
1429 | 1470 | ), |
| 1471 | + "lineno": find_class_line_number( |
| 1472 | + "TestClass2", TEST_DATA_PATH / "test_param_span_class.py" |
| 1473 | + ), |
1430 | 1474 | }, |
1431 | 1475 | ], |
1432 | 1476 | } |
|
1503 | 1547 | "pytest_describe_plugin/describe_only.py::describe_A", |
1504 | 1548 | describe_only_path, |
1505 | 1549 | ), |
| 1550 | + "lineno": find_class_line_number( |
| 1551 | + "describe_A", describe_only_path |
| 1552 | + ), |
1506 | 1553 | } |
1507 | 1554 | ], |
1508 | 1555 | } |
|
1586 | 1633 | "pytest_describe_plugin/nested_describe.py::describe_list::describe_append", |
1587 | 1634 | nested_describe_path, |
1588 | 1635 | ), |
| 1636 | + "lineno": find_class_line_number( |
| 1637 | + "describe_append", nested_describe_path |
| 1638 | + ), |
1589 | 1639 | }, |
1590 | 1640 | { |
1591 | 1641 | "name": "describe_remove", |
|
1614 | 1664 | "pytest_describe_plugin/nested_describe.py::describe_list::describe_remove", |
1615 | 1665 | nested_describe_path, |
1616 | 1666 | ), |
| 1667 | + "lineno": find_class_line_number( |
| 1668 | + "describe_remove", nested_describe_path |
| 1669 | + ), |
1617 | 1670 | }, |
1618 | 1671 | ], |
1619 | 1672 | "id_": get_absolute_test_id( |
1620 | 1673 | "pytest_describe_plugin/nested_describe.py::describe_list", |
1621 | 1674 | nested_describe_path, |
1622 | 1675 | ), |
| 1676 | + "lineno": find_class_line_number( |
| 1677 | + "describe_list", nested_describe_path |
| 1678 | + ), |
1623 | 1679 | } |
1624 | 1680 | ], |
1625 | 1681 | } |
|
0 commit comments