Skip to content

Commit

Permalink
No verbose traceback for layout() method (#9384)
Browse files Browse the repository at this point in the history
* Handling conanfile.layout() traceback output

* Added generate() method as well

* Added export methods as well
  • Loading branch information
franramirez688 committed Aug 6, 2021
1 parent 916cb10 commit c1ab505
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion conans/client/conanfile/configure.py
Expand Up @@ -41,4 +41,5 @@ def run_configure_method(conanfile, down_options, down_ref, ref):

# Once the node is configured call the layout()
if hasattr(conanfile, "layout"):
conanfile.layout()
with conanfile_exception_formatter(str(conanfile), "layout"):
conanfile.layout()
3 changes: 2 additions & 1 deletion conans/test/integration/conanfile/test_exception_printing.py
Expand Up @@ -31,7 +31,8 @@ def test_all_methods(direct):
else:
throw = "self._aux_method()"
for method in ["source", "build", "package", "package_info", "configure", "build_id",
"package_id", "requirements", "config_options"]:
"package_id", "requirements", "config_options", "layout", "generate", "export",
"export_sources"]:
client.save({CONANFILE: conanfile.format(method=method, method_contents=throw)})
client.run("create . ", assert_error=True)
assert "exceptions/0.1: Error in %s() method, line 12" % method in client.out
Expand Down

0 comments on commit c1ab505

Please sign in to comment.