Elffuss BraidHub

kikocis/auto-code-rover public

main · 8.0 KiBRawPermalink
1{
2 "task_id": "pytest-dev__pytest-5227",
3 "setup_info": {
4 "repo_path": "/home/haifeng/projects/reverse-prompt/SWE-bench/testbed/pytest-dev__pytest/setup_pytest-dev__pytest__4.4",
5 "env_name": "setup_pytest-dev__pytest__4.4",
6 "pre_install": [],
7 "install": "python -m pip install -e .",
8 "test_cmd": "pytest -rA testing/logging/test_reporting.py"
9 },
10 "task_info": {
11 "instance_id": "pytest-dev__pytest-5227",
12 "base_commit": "2051e30b9b596e944524ccb787ed20f9f5be93e3",
13 "hints_text": "",
14 "created_at": "2019-05-07T20:27:24Z",
15 "test_patch": "diff --git a/testing/logging/test_reporting.py b/testing/logging/test_reporting.py\n--- a/testing/logging/test_reporting.py\n+++ b/testing/logging/test_reporting.py\n@@ -248,7 +248,7 @@ def test_log_cli():\n [\n \"test_log_cli_enabled_disabled.py::test_log_cli \",\n \"*-- live log call --*\",\n- \"test_log_cli_enabled_disabled.py* CRITICAL critical message logged by test\",\n+ \"CRITICAL *test_log_cli_enabled_disabled.py* critical message logged by test\",\n \"PASSED*\",\n ]\n )\n@@ -282,7 +282,7 @@ def test_log_cli(request):\n result.stdout.fnmatch_lines(\n [\n \"test_log_cli_default_level.py::test_log_cli \",\n- \"test_log_cli_default_level.py*WARNING message will be shown*\",\n+ \"WARNING*test_log_cli_default_level.py* message will be shown*\",\n ]\n )\n assert \"INFO message won't be shown\" not in result.stdout.str()\n@@ -523,7 +523,7 @@ def test_log_1(fix):\n )\n assert (\n re.search(\n- r\"(.+)live log teardown(.+)\\n(.+)WARNING(.+)\\n(.+)WARNING(.+)\",\n+ r\"(.+)live log teardown(.+)\\nWARNING(.+)\\nWARNING(.+)\",\n result.stdout.str(),\n re.MULTILINE,\n )\n@@ -531,7 +531,7 @@ def test_log_1(fix):\n )\n assert (\n re.search(\n- r\"(.+)live log finish(.+)\\n(.+)WARNING(.+)\\n(.+)WARNING(.+)\",\n+ r\"(.+)live log finish(.+)\\nWARNING(.+)\\nWARNING(.+)\",\n result.stdout.str(),\n re.MULTILINE,\n )\n@@ -565,7 +565,7 @@ def test_log_cli(request):\n # fnmatch_lines does an assertion internally\n result.stdout.fnmatch_lines(\n [\n- \"test_log_cli_level.py*This log message will be shown\",\n+ \"*test_log_cli_level.py*This log message will be shown\",\n \"PASSED\", # 'PASSED' on its own line because the log message prints a new line\n ]\n )\n@@ -579,7 +579,7 @@ def test_log_cli(request):\n # fnmatch_lines does an assertion internally\n result.stdout.fnmatch_lines(\n [\n- \"test_log_cli_level.py* This log message will be shown\",\n+ \"*test_log_cli_level.py* This log message will be shown\",\n \"PASSED\", # 'PASSED' on its own line because the log message prints a new line\n ]\n )\n@@ -615,7 +615,7 @@ def test_log_cli(request):\n # fnmatch_lines does an assertion internally\n result.stdout.fnmatch_lines(\n [\n- \"test_log_cli_ini_level.py* This log message will be shown\",\n+ \"*test_log_cli_ini_level.py* This log message will be shown\",\n \"PASSED\", # 'PASSED' on its own line because the log message prints a new line\n ]\n )\n",
16 "repo": "pytest-dev/pytest",
17 "problem_statement": "Improve default logging format\nCurrently it is:\r\n\r\n> DEFAULT_LOG_FORMAT = \"%(filename)-25s %(lineno)4d %(levelname)-8s %(message)s\"\r\n\r\nI think `name` (module name) would be very useful here, instead of just the base filename.\r\n\r\n(It might also be good to have the relative path there (maybe at the end), but it is usually still very long (but e.g. `$VIRTUAL_ENV` could be substituted therein))\r\n\r\nCurrently it would look like this:\r\n```\r\nutils.py 114 DEBUG (0.000) SELECT \"app_url\".\"id\", \"app_url\".\"created\", \"app_url\".\"url\" FROM \"app_url\" WHERE \"app_url\".\"id\" = 2; args=(2,)\r\nmultipart.py 604 DEBUG Calling on_field_start with no data\r\n```\r\n\r\n\r\nUsing `DEFAULT_LOG_FORMAT = \"%(levelname)-8s %(name)s:%(filename)s:%(lineno)d %(message)s\"` instead:\r\n\r\n```\r\nDEBUG django.db.backends:utils.py:114 (0.000) SELECT \"app_url\".\"id\", \"app_url\".\"created\", \"app_url\".\"url\" FROM \"app_url\" WHERE \"app_url\".\"id\" = 2; args=(2,)\r\nDEBUG multipart.multipart:multipart.py:604 Calling on_field_start with no data\r\n```\n",
18 "version": "4.4",
19 "FAIL_TO_PASS": [
20 "testing/logging/test_reporting.py::test_log_cli_default_level",
21 "testing/logging/test_reporting.py::test_log_cli_enabled_disabled[True]",
22 "testing/logging/test_reporting.py::test_sections_single_new_line_after_test_outcome"
23 ],
24 "PASS_TO_PASS": [
25 "[",
26 "[100%]",
27 "[100%]------------------------------",
28 "testing/logging/test_reporting.py::test_collection_live_logging",
29 "testing/logging/test_reporting.py::test_collection_logging_to_file",
30 "testing/logging/test_reporting.py::test_disable_log_capturing",
31 "testing/logging/test_reporting.py::test_disable_log_capturing_ini",
32 "testing/logging/test_reporting.py::test_live_logging_suspends_capture[False]",
33 "testing/logging/test_reporting.py::test_live_logging_suspends_capture[True]",
34 "testing/logging/test_reporting.py::test_live_logs_unknown_sections",
35 "testing/logging/test_reporting.py::test_log_cli_auto_enable[--log-cli-level=WARNING]",
36 "testing/logging/test_reporting.py::test_log_cli_auto_enable[--log-file-level=WARNING]",
37 "testing/logging/test_reporting.py::test_log_cli_auto_enable[--log-level=WARNING]",
38 "testing/logging/test_reporting.py::test_log_cli_auto_enable[]",
39 "testing/logging/test_reporting.py::test_log_cli_default_level_multiple_tests",
40 "testing/logging/test_reporting.py::test_log_cli_default_level_sections",
41 "testing/logging/test_reporting.py::test_log_cli_enabled_disabled[False]",
42 "testing/logging/test_reporting.py::test_log_cli_ini_level",
43 "testing/logging/test_reporting.py::test_log_cli_level",
44 "testing/logging/test_reporting.py::test_log_cli_level_log_level_interaction",
45 "testing/logging/test_reporting.py::test_log_file_cli",
46 "testing/logging/test_reporting.py::test_log_file_cli_level",
47 "testing/logging/test_reporting.py::test_log_file_ini",
48 "testing/logging/test_reporting.py::test_log_file_ini_level",
49 "testing/logging/test_reporting.py::test_log_file_unicode",
50 "testing/logging/test_reporting.py::test_log_in_hooks",
51 "testing/logging/test_reporting.py::test_log_in_runtest_logreport",
52 "testing/logging/test_reporting.py::test_log_level_not_changed_by_default",
53 "testing/logging/test_reporting.py::test_log_set_path",
54 "testing/logging/test_reporting.py::test_messages_logged",
55 "testing/logging/test_reporting.py::test_nothing_logged",
56 "testing/logging/test_reporting.py::test_root_logger_affected",
57 "testing/logging/test_reporting.py::test_setup_logging",
58 "testing/logging/test_reporting.py::test_teardown_logging"
59 ],
60 "environment_setup_commit": "4ccaa987d47566e3907f2f74167c4ab7997f622f",
61 "patch": "diff --git a/src/_pytest/logging.py b/src/_pytest/logging.py\n--- a/src/_pytest/logging.py\n+++ b/src/_pytest/logging.py\n@@ -15,7 +15,7 @@\n from _pytest.config import create_terminal_writer\n from _pytest.pathlib import Path\n \n-DEFAULT_LOG_FORMAT = \"%(filename)-25s %(lineno)4d %(levelname)-8s %(message)s\"\n+DEFAULT_LOG_FORMAT = \"%(levelname)-8s %(name)s:%(filename)s:%(lineno)d %(message)s\"\n DEFAULT_LOG_DATE_FORMAT = \"%H:%M:%S\"\n \n \n",
62 "pr_link": "https://github.com/pytest-dev/pytest/pull/5227"
63 }
64}