File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
src/pytest_plugins/filler Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ Test fixtures for use by clients are available for each release on the [Github r
1212
1313#### ` fill `
1414
15+ - 🐞 Fix the reported fixture source URLs for the case of auto-generated tests ([ #1488 ] ( https://github.com/ethereum/execution-spec-tests/pull/1488 ) ).
16+
1517#### ` consume `
1618
1719### 📋 Misc
Original file line number Diff line number Diff line change @@ -659,12 +659,22 @@ def fixture_source_url(
659659 if hasattr (request .node , "github_url" ):
660660 return request .node .github_url
661661 function_line_number = request .function .__code__ .co_firstlineno
662- module_relative_path = os .path .relpath (request .module .__file__ )
662+ module_relative_path = os .path .relpath (request .function .__code__ .co_filename )
663+
663664 github_url = generate_github_url (
664665 module_relative_path ,
665666 branch_or_commit_or_tag = commit_hash_or_tag ,
666667 line_number = function_line_number ,
667668 )
669+ test_module_relative_path = os .path .relpath (request .module .__file__ )
670+ if module_relative_path != test_module_relative_path :
671+ # This can be the case when the test function's body only contains pass and the entire
672+ # test logic is implemented as a test generator from the framework.
673+ test_module_github_url = generate_github_url (
674+ test_module_relative_path ,
675+ branch_or_commit_or_tag = commit_hash_or_tag ,
676+ )
677+ github_url += f" called via `{ request .node .originalname } ()` in { test_module_github_url } "
668678 return github_url
669679
670680
You can’t perform that action at this time.
0 commit comments