lib-python/3/test/test_tabnanny.py::unmodified
== PyPy 3.12.13 (a3c6b428e7a8, Jul 09 2026, 03:38:33) [PyPy 8.0.0-alpha0 with GCC 10.2.1 20210130 (Red Hat 10.2.1-11)]
== Linux-5.4.0-182-generic-i686-with-glibc2.17 little-endian
== Python build: release with_assert
== cwd: /build_dir/tmp/pytest/test_python_worker_2022947æ
== CPU count: 8
== encodings: locale=UTF-8 FS=utf-8
== resources (3): curses,gui,network
Using random seed: 1869090565
0:00:00 load avg: 4.97 Run 1 test sequentially in a single process
0:00:00 load avg: 4.97 [1/1] test_tabnanny
test_correct_directory (test.test_tabnanny.TestCheck.test_correct_directory)
Directory which contains few error free python source code files. ... ok
test_correct_directory_verbose (test.test_tabnanny.TestCheck.test_correct_directory_verbose)
Directory containing few error free python source code files. ... ok
test_correct_file (test.test_tabnanny.TestCheck.test_correct_file)
A python source code file without any errors. ... ok
test_errored_directory (test.test_tabnanny.TestCheck.test_errored_directory)
Directory containing wrongly indented python source code files. ... ok
test_when_nannynag_error (test.test_tabnanny.TestCheck.test_when_nannynag_error)
A python source code file eligible for raising `tabnanny.NannyNag`. ... FAIL
test_when_nannynag_error_verbose (test.test_tabnanny.TestCheck.test_when_nannynag_error_verbose)
A python source code file eligible for raising `tabnanny.NannyNag`. ... FAIL
test_when_no_file (test.test_tabnanny.TestCheck.test_when_no_file)
A python file which does not exist actually in system. ... ok
test_when_tokenize_tokenerror (test.test_tabnanny.TestCheck.test_when_tokenize_tokenerror)
A python source code file eligible for raising 'tokenize.TokenError'. ... ERROR
test_when_wrong_indented (test.test_tabnanny.TestCheck.test_when_wrong_indented)
A python source code file eligible for raising `IndentationError`. ... ok
test_command_usage (test.test_tabnanny.TestCommandLine.test_command_usage)
Should display usage on no arguments. ... ok
test_double_verbose_mode (test.test_tabnanny.TestCommandLine.test_double_verbose_mode)
Should display detailed error information if double verbose is on. ...
test_double_verbose_mode (test.test_tabnanny.TestCommandLine.test_double_verbose_mode) (std='offending line: \'\\tprint("world")\'', output=["checking '/build_dir/tmp/pytest/tmpxxx0b5ro.py' ...", "'/build_dir/tmp/pytest/tmpxxx0b5ro.py': *** Line 3: trouble in tab city! ***", 'offending line: \'\\tprint("world")\\n\'', 'indent not equal e.g. at tab size 1'])
Should display detailed error information if double verbose is on. ... FAIL
test_quiet_flag (test.test_tabnanny.TestCommandLine.test_quiet_flag)
Should display less when quite mode is on. ... ok
test_verbose_mode (test.test_tabnanny.TestCommandLine.test_verbose_mode)
Should display more error information if verbose mode is on. ...
test_verbose_mode (test.test_tabnanny.TestCommandLine.test_verbose_mode) (std='offending line: \'\\tprint("world")\'', output=["'/build_dir/tmp/pytest/tmp6cc96vaw.py': *** Line 3: trouble in tab city! ***", 'offending line: \'\\tprint("world")\\n\'', 'indent not equal e.g. at tab size 1'])
Should display more error information if verbose mode is on. ... FAIL
test_with_error_free_file (test.test_tabnanny.TestCommandLine.test_with_error_free_file)
Should not display anything if python file is correctly indented. ... ok
test_with_errored_file (test.test_tabnanny.TestCommandLine.test_with_errored_file)
Should displays error when errored python file is given. ... FAIL
test_errprint (test.test_tabnanny.TestErrPrint.test_errprint)
Asserting result of `tabnanny.errprint()` by giving sample inputs. ... ok
test_format_witnesses (test.test_tabnanny.TestFormatWitnesses.test_format_witnesses)
Asserting formatter result by giving various input samples. ... ok
test_all_methods (test.test_tabnanny.TestNannyNag.test_all_methods)
Asserting behaviour of `tabnanny.NannyNag` exception. ... ok
test_with_correct_code (test.test_tabnanny.TestProcessTokens.test_with_correct_code)
A python source code without any whitespace related problems. ... ok
test_with_errored_codes_samples (test.test_tabnanny.TestProcessTokens.test_with_errored_codes_samples)
A python source code with whitespace related sampled problems. ... ok
======================================================================
ERROR: test_when_tokenize_tokenerror (test.test_tabnanny.TestCheck.test_when_tokenize_tokenerror)
A python source code file eligible for raising 'tokenize.TokenError'.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/test/test_tabnanny.py", line 216, in test_when_tokenize_tokenerror
self.verify_tabnanny_check(file_path, err=err)
^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/test/test_tabnanny.py", line 162, in verify_tabnanny_check
tabnanny.check(dir_or_file)
^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/tabnanny.py", line 104, in check
process_tokens(tokenize.generate_tokens(f.readline))
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/tabnanny.py", line 280, in process_tokens
_process_tokens(tokens)
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/tabnanny.py", line 292, in _process_tokens
for (type, token, start, end, line) in tokens:
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/tokenize.py", line 584, in _generate_tokens_from_c_tokenizer
for info in it:
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib_pypy/_tokenize.py", line 699, in __next__
return next(self._iter)
^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib_pypy/_tokenize.py", line 575, in _generate
raise SyntaxError("EOF in multi-line statement", (lnum, 0))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: function missing required argument 'info[3]' (pos 4)
======================================================================
FAIL: test_when_nannynag_error (test.test_tabnanny.TestCheck.test_when_nannynag_error)
A python source code file eligible for raising `tabnanny.NannyNag`.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/test/test_tabnanny.py", line 235, in test_when_nannynag_error
self.verify_tabnanny_check(file_path, out=out)
^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/test/test_tabnanny.py", line 163, in verify_tabnanny_check
self.assertEqual(stdout.getvalue(), out)
^^^^^^^^^^^
AssertionError: '/build_dir/tmp/pytest/tmpsfefow2d.py 3 \'\\tprint("world")\\n\'\n' != '/build_dir/tmp/pytest/tmpsfefow2d.py 3 \'\\tprint("world")\'\n'
- /build_dir/tmp/pytest/tmpsfefow2d.py 3 '\tprint("world")\n'
? --
+ /build_dir/tmp/pytest/tmpsfefow2d.py 3 '\tprint("world")'
======================================================================
FAIL: test_when_nannynag_error_verbose (test.test_tabnanny.TestCheck.test_when_nannynag_error_verbose)
A python source code file eligible for raising `tabnanny.NannyNag`.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/test/test_tabnanny.py", line 229, in test_when_nannynag_error_verbose
self.verify_tabnanny_check(file_path, out=out)
^^^^^^^^^^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/test/test_tabnanny.py", line 163, in verify_tabnanny_check
self.assertEqual(stdout.getvalue(), out)
^^^^^^^^^^^
AssertionError: '\'/b[105 chars]orld")\\n\'\nindent not equal e.g. at tab size 1\n' != '\'/b[105 chars]orld")\'\ninconsistent use of tabs and spaces in indentation\n'
'/build_dir/tmp/pytest/tmpdzvre34u.py': *** Line 3: trouble in tab city! ***
- offending line: '\tprint("world")\n'
? --
+ offending line: '\tprint("world")'
- indent not equal e.g. at tab size 1
+ inconsistent use of tabs and spaces in indentation
======================================================================
FAIL: test_double_verbose_mode (test.test_tabnanny.TestCommandLine.test_double_verbose_mode) (std='offending line: \'\\tprint("world")\'', output=["checking '/build_dir/tmp/pytest/tmpxxx0b5ro.py' ...", "'/build_dir/tmp/pytest/tmpxxx0b5ro.py': *** Line 3: trouble in tab city! ***", 'offending line: \'\\tprint("world")\\n\'', 'indent not equal e.g. at tab size 1'])
Should display detailed error information if double verbose is on.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/test/test_tabnanny.py", line 310, in validate_cmd
self.assertIn(_std, _output)
^^^^^^^^
AssertionError: 'offending line: \'\\tprint("world")\'' not found in ["checking '/build_dir/tmp/pytest/tmpxxx0b5ro.py' ...", "'/build_dir/tmp/pytest/tmpxxx0b5ro.py': *** Line 3: trouble in tab city! ***", 'offending line: \'\\tprint("world")\\n\'', 'indent not equal e.g. at tab size 1']
======================================================================
FAIL: test_verbose_mode (test.test_tabnanny.TestCommandLine.test_verbose_mode) (std='offending line: \'\\tprint("world")\'', output=["'/build_dir/tmp/pytest/tmp6cc96vaw.py': *** Line 3: trouble in tab city! ***", 'offending line: \'\\tprint("world")\\n\'', 'indent not equal e.g. at tab size 1'])
Should display more error information if verbose mode is on.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/test/test_tabnanny.py", line 310, in validate_cmd
self.assertIn(_std, _output)
^^^^^^^^
AssertionError: 'offending line: \'\\tprint("world")\'' not found in ["'/build_dir/tmp/pytest/tmp6cc96vaw.py': *** Line 3: trouble in tab city! ***", 'offending line: \'\\tprint("world")\\n\'', 'indent not equal e.g. at tab size 1']
======================================================================
FAIL: test_with_errored_file (test.test_tabnanny.TestCommandLine.test_with_errored_file)
Should displays error when errored python file is given.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/test/test_tabnanny.py", line 321, in test_with_errored_file
self.validate_cmd(file_path, stderr=stderr, expect_failure=True)
^^^^^^^^^^^^
File "/build_dir/pypy-c-jit-linux-x86-32/build/lib-python/3/test/test_tabnanny.py", line 313, in validate_cmd
self.assertListEqual(err.splitlines(), stderr.splitlines())
^^^^^^^^^^^^^^^
AssertionError: Lists differ: ["'/b[67 chars]es not match any outer indentation level (<tokenize>, line 3)"] != ["'/b[67 chars]es not match any outer indentation level (<string>, line 3)"]
First differing element 0:
"'/bu[65 chars]oes not match any outer indentation level (<tokenize>, line 3)"
"'/bu[65 chars]oes not match any outer indentation level (<string>, line 3)"
["'/build_dir/tmp/pytest/tmpbad_kyzb.py': Indentation Error: unindent does not "
- 'match any outer indentation level (<tokenize>, line 3)']
? ^^^ ^^^
+ 'match any outer indentation level (<string>, line 3)']
? + ^^ ^
----------------------------------------------------------------------
Ran 20 tests in 0.926s
FAILED (failures=5, errors=1)
0:00:01 load avg: 4.97 [1/1/1] test_tabnanny failed (1 error, 5 failures)
== Tests result: FAILURE ==
1 test failed:
test_tabnanny
Total duration: 1.4 sec
Total tests: run=20 failures=5
Total test files: run=1/1 failed=1
Result: FAILURE
test test_tabnanny failed
builder: pypy-c-jit-linux-x86-32 build #8377+
test: lib-python/3/test/test_tabnanny.py::unmodified