This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: make test: module test that failed doesn't exist
Type: Stage: resolved
Components: Documentation Versions: Python 3.8, Python 3.7, Python 3.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, ned.deily, pmatos, r.david.murray, steven.downum
Priority: normal Keywords: easy, patch

Created on 2017-08-14 10:43 by pmatos, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 6417 merged Aaron Ang, 2018-04-08 07:57
PR 6437 merged miss-islington, 2018-04-09 21:10
PR 6438 merged miss-islington, 2018-04-09 21:11
Messages (8)
msg300241 - (view) Author: Paulo Matos (pmatos) Date: 2017-08-14 10:43
Trying to rerun the tests that failed but it just says that the module doesn't exist. I am running the exact command line mentioned in the readme file:

$ make test TESTOPTS="-v test_that_failed"
running build
running build_ext

The following modules found by detect_modules() in setup.py, have been
built by the Makefile instead, as configured by the Setup files:
atexit                pwd                   time               

running build_scripts
copying and adjusting /home/pmatos/Projects/cpython/Tools/scripts/pydoc3 -> build/scripts-3.7
copying and adjusting /home/pmatos/Projects/cpython/Tools/scripts/idle3 -> build/scripts-3.7
copying and adjusting /home/pmatos/Projects/cpython/Tools/scripts/2to3 -> build/scripts-3.7
copying and adjusting /home/pmatos/Projects/cpython/Tools/scripts/pyvenv -> build/scripts-3.7
changing mode of build/scripts-3.7/pydoc3 from 664 to 775
changing mode of build/scripts-3.7/idle3 from 664 to 775
changing mode of build/scripts-3.7/2to3 from 664 to 775
changing mode of build/scripts-3.7/pyvenv from 664 to 775
renaming build/scripts-3.7/pydoc3 to build/scripts-3.7/pydoc3.7
renaming build/scripts-3.7/idle3 to build/scripts-3.7/idle3.7
renaming build/scripts-3.7/2to3 to build/scripts-3.7/2to3-3.7
renaming build/scripts-3.7/pyvenv to build/scripts-3.7/pyvenv-3.7
./python  ../Tools/scripts/run_tests.py -v test_that_failed
/home/pmatos/Projects/cpython/debug/python -u -W default -bb -E -W error::BytesWarning -m test -r -w -j 0 -u all,-largefile,-audio,-gui -v test_that_failed
== CPython 3.7.0a0 (heads/master:48d9823a0e, Aug 14 2017, 11:53:56) [GCC 7.1.1 20170622 (Red Hat 7.1.1-3)]
== Linux-4.11.11-300.fc26.x86_64-x86_64-with-fedora-26-Twenty_Six little-endian
== hash algorithm: siphash24 64bit
== cwd: /home/pmatos/Projects/cpython/debug/build/test_python_22582
== CPU count: 16
== encodings: locale=UTF-8, FS=utf-8
Testing with flags: sys.flags(debug=0, inspect=0, interactive=0, optimize=0, dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=1, verbose=0, bytes_warning=2, quiet=0, hash_randomization=1, isolated=0)
Using random seed 8085058
Run tests in parallel using 18 child processes
0:00:00 load avg: 15.90 [1/1/1] test_that_failed failed
test test_that_failed crashed -- Traceback (most recent call last):
  File "/home/pmatos/Projects/cpython/Lib/test/libregrtest/runtest.py", line 163, in runtest_inner
    the_module = importlib.import_module(abstest)
  File "/home/pmatos/Projects/cpython/Lib/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'test.test_that_failed'

1 test failed:
    test_that_failed
Re-running failed tests in verbose mode
Re-running test 'test_that_failed' in verbose mode
test test_that_failed crashed -- Traceback (most recent call last):
  File "/home/pmatos/Projects/cpython/Lib/test/libregrtest/runtest.py", line 163, in runtest_inner
    the_module = importlib.import_module(abstest)
  File "/home/pmatos/Projects/cpython/Lib/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'test.test_that_failed'

1 test failed again:
    test_that_failed

Total duration: 355 ms
Tests result: FAILURE
make: *** [Makefile:1019: test] Error 2
msg300250 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2017-08-14 15:10
Replace "test_that_failed" with the name of the test that failed.

The README could be improved by saying:

If any tests fail, you can re-run the failing test(s) in verbose mode.  For example if, 'test_os' and 'test_gdb' failed, you can run::

     make test TESTOPTS="-v test_os test_gdb"
msg300251 - (view) Author: Paulo Matos (pmatos) Date: 2017-08-14 15:21
Argh, apologies David. I hadn't noticed the mistake. I simply copy/pasted and was expecting the command line to rerun all the tests that had previously failed. I was assuming the suite had some kind of state that recorded the tests that previously failed and ran only those. :)
msg300252 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2017-08-14 15:28
Yep, I figured that.  That's why I suggested the clarification to the README, if someone wants to generate a PR for it.
msg315149 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2018-04-09 21:09
New changeset 0f914b5b5f6ba186afd7112fc851c97247076f70 by Ned Deily (Aaron Ang) in branch 'master':
bpo-31201: Clarify command to re-run failing test(s) with example (GH-6417)
https://github.com/python/cpython/commit/0f914b5b5f6ba186afd7112fc851c97247076f70
msg315150 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2018-04-09 21:17
New changeset 71a3837bf39580ffa828c14247230a9277b9d5b1 by Ned Deily (Miss Islington (bot)) in branch '3.7':
[3.7] bpo-31201: Clarify command to re-run failing test(s) with example (GH-6417) (GH-6437)
https://github.com/python/cpython/commit/71a3837bf39580ffa828c14247230a9277b9d5b1
msg315151 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2018-04-09 21:19
New changeset 83bb39907ec3828aec6d99bb9338283bd6b30ac2 by Ned Deily (Miss Islington (bot)) in branch '3.6':
[3.6] bpo-31201: Clarify command to re-run failing test(s) with example (GH-6417) (GH-6438)
https://github.com/python/cpython/commit/83bb39907ec3828aec6d99bb9338283bd6b30ac2
msg315152 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2018-04-09 21:21
Thanks for the PR, Aaron!
History
Date User Action Args
2022-04-11 14:58:50adminsetgithub: 75384
2018-04-09 21:21:01ned.deilysetstatus: open -> closed
versions: + Python 3.6
type: enhancement ->
messages: + msg315152

resolution: fixed
stage: patch review -> resolved
2018-04-09 21:19:34ned.deilysetmessages: + msg315151
2018-04-09 21:17:23ned.deilysetmessages: + msg315150
2018-04-09 21:11:41miss-islingtonsetpull_requests: + pull_request6134
2018-04-09 21:10:48miss-islingtonsetpull_requests: + pull_request6133
2018-04-09 21:09:40ned.deilysetnosy: + ned.deily
messages: + msg315149
2018-04-08 07:57:48Aaron Angsetkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request6119
2018-04-03 15:34:06steven.downumsetnosy: + steven.downum
2018-03-26 15:24:20cheryl.sabellasetkeywords: + easy
title: module test that failed doesn't exist -> make test: module test that failed doesn't exist
stage: needs patch
type: enhancement
versions: + Python 3.7, Python 3.8
2017-08-14 15:28:25r.david.murraysetmessages: + msg300252
2017-08-14 15:21:08pmatossetmessages: + msg300251
2017-08-14 15:10:59r.david.murraysetnosy: + r.david.murray, docs@python
messages: + msg300250

assignee: docs@python
components: + Documentation, - Tests
2017-08-14 10:43:48pmatoscreate