misleading/cryptic exception message when invoking testr run with logically wrong arguments
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Testrepository |
Incomplete
|
High
|
Unassigned |
Bug Description
I ran into this problem while running my first try of testrepository due to a mixup of how I usually run tests with unittest and what the default config suggests (http://
I couldn't figure out how to get a traceback for the exception, so below are the relevant commands and their output for reproducing it (I included platform/version info too, though I expect the error effects all versions/platforms) in an empty (testr init) repo
My suggestion would be to turn it into a testr-specific error message, such as "incorrect options passed to run - no tests matching name <whatever passed in>"
=======
$ win_info
OS Name: Microsoft Windows 7 Professional
OS Manufacturer: Microsoft Corporation
System Type: x64-based PC
System Locale: en-us;English (United States)
Input Locale: en-us;English (United States)
$ python --version
Python 2.7.4
$ pip freeze
extras==0.0.3
fixtures==0.3.14
python-
python-
testrepository=
testtools==0.9.32
$ git --version
git version 1.8.1.msysgit.1
$ grep ^ -nH bugrepro/test.py bugrepro/
bugrepro/
bugrepro/test.py:2:
bugrepro/test.py:3:
bugrepro/
bugrepro/test.py:5:
bugrepro/test.py:6: def test_one(self):
bugrepro/test.py:7: self.fail('one')
bugrepro/test.py:8:
bugrepro/test.py:9: def test_two(self):
bugrepro/
$ python -m unittest discover bugrepro
F.
=======
FAIL: test_one (test.SampleTest)
-------
Traceback (most recent call last):
File "c:\Users\
self.
AssertionError: one
-------
Ran 2 tests in 0.000s
FAILED (failures=1)
$ ls .testr.conf .testr.conf.swp .testr.conf~ .testrepository -l
-rw-r--r-- 1 zsoldosp Administ 205 Sep 11 14:46 .testr.conf
-rw-r--r-- 1 zsoldosp Administ 12288 Sep 11 14:44 .testr.conf.swp
-rw-r--r-- 1 zsoldosp Administ 212 Sep 11 14:45 .testr.conf~
.testrepository:
total 1
-rw-r--r-- 1 zsoldosp Administ 3 Sep 11 16:28 format
-rw-r--r-- 1 zsoldosp Administ 3 Sep 11 16:28 next-stream
$ cat .testr.conf
[DEFAULT]
#test_command=
test_command=python -m subunit.run discover . $LISTOPT $IDOPTION
test_id_
test_list_
$ testr run bugrepro
running=python -m subunit.run discover . --list
'unicodeescape' codec can't decode bytes in position 56-57: truncated \uXXXX escape
$ testr run
running=python -m subunit.run discover .
=======
FAIL: bugrepro.
tags: worker-0
-------
Traceback (most recent call last):
File "c:\Users\
self.
File "c:\Python27\
raise self.failureExc
AssertionError: one
=======
FAIL: process-returncode
tags: worker-0
-------
Binary content:
traceback (test/plain; charset="utf8")
Ran 5 tests in 0.019s
FAILED (id=0, failures=2)
Sorry, I'm not clear whats going wrong. It looks like you have a script to demonstrate it - could you please attach that to the bug, which will let me see it without the webformatting corrupting it.