[issue40690] unittest: if FunctionTestCase is imported, the loader loads "tests" from it

2020-05-19 Thread Vitalii


New submission from Vitalii :

In [2]: from unittest import FunctionTestCase   

   

In [3]: loader.loadTestsFromTestCase(FunctionTestCase)  


Out[3]: ]>

In [4]: test = _._tests[0]; test 
Out[4]: 

In [5]: test._testFunc  

  
Out[5]: 'runTest'

In [6]: test._testFunc.__name__ 

  
*** AttributeError: 'str' object has no attribute '__name__'

--
components: Tests
messages: 369386
nosy: pwtail
priority: normal
severity: normal
status: open
title: unittest: if FunctionTestCase is imported, the loader loads "tests" from 
it
type: behavior
versions: Python 3.8, Python 3.9

___
Python tracker 
<https://bugs.python.org/issue40690>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40690] unittest: if FunctionTestCase is imported, the loader loads "tests" from it

2020-05-19 Thread Vitalii


Change by Vitalii :


--
keywords: +patch
pull_requests: +19524
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/20237

___
Python tracker 
<https://bugs.python.org/issue40690>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40690] unittest: if FunctionTestCase is imported, the loader loads "tests" from it

2020-05-21 Thread Vitalii


Vitalii  added the comment:

If you make an import in a module with your tests

>From unittest import FunctionTestCase

then you will have 1 extra test in that module (the imported one), moreover, 
that test will be broken.

--

___
Python tracker 
<https://bugs.python.org/issue40690>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40690] unittest: if FunctionTestCase is imported, the loader loads "tests" from it

2020-05-22 Thread Vitalii


Vitalii  added the comment:

I don't think anyone is using FunctionTestCase

--

___
Python tracker 
<https://bugs.python.org/issue40690>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com