New submission from STINNER Victor <vstin...@redhat.com>:

Python test runner regrtest has many options to select tests: -u (resources), 
-m and --matchfile, -x (exclude), etc. Sometimes, I do a mistake and I run 0 
test, but I still get a success.

Maybe regrtest should be modified to fail with an error when no test is run? At 
least, it would help to understand my mistake if regrtest could emit a warning 
in such case.

Example:
---
$ ./python  -W error  -m test test_asyncio -m 
test_set_default_executor_deprecation_warnings 
Run tests sequentially
0:00:00 load avg: 0.27 [1/1] test_asyncio

== Tests result: SUCCESS ==

1 test OK.

Total duration: 266 ms
Tests result: SUCCESS
---

Success ok, but is there a typo in the test method?

Another example:
---
$ ./python  -W error  -m test test_asyncio -m test_no_such_test -v
== CPython 3.8.0a0 (heads/pr/8533:50c0499950, Jul 30 2018, 12:41:53) [GCC 8.1.1 
20180712 (Red Hat 8.1.1-5)]
== Linux-4.17.6-200.fc28.x86_64-x86_64-with-glibc2.26 little-endian
== cwd: /home/vstinner/prog/python/master/build/test_python_5505
== CPU count: 8
== encodings: locale=UTF-8, FS=utf-8
Run tests sequentially
0:00:00 load avg: 0.31 [1/1] test_asyncio

----------------------------------------------------------------------
Ran 0 tests in 0.001s

OK

== Tests result: SUCCESS ==

1 test OK.

Total duration: 318 ms
Tests result: SUCCESS
---

Success but no test have been executed. It's not obvious at all without the 
verbose mode:
---
$ ./python  -W error  -m test test_asyncio -m test_no_such_test 
Run tests sequentially
0:00:00 load avg: 0.31 [1/1] test_asyncio

== Tests result: SUCCESS ==

1 test OK.

Total duration: 260 ms
Tests result: SUCCESS
---

----------
components: Tests
messages: 322667
nosy: pablogsal, serhiy.storchaka, vstinner
priority: normal
severity: normal
status: open
title: RFC: issue a warning in regrtest when no test have been executed?
versions: Python 3.8

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue34279>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to