[issue46198] Duplicated test name `test_get_unstructured_invalid_ew` in `test__header_value_parser.py`

2021-12-31 Thread Éric Araujo

Éric Araujo  added the comment:

Sometimes people fix small things in multiple modules, sometimes they create 
separate tickets to have one patch per module with reviews from different 
maintainers and so on.  For this case, I check pyflakes and found a handful of 
true positives, so I would retitle the ticket to be about duplicate methods in 
tests.

--
Added file: https://bugs.python.org/file50534/duplicate-test-methods.diff

___
Python tracker 

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



[issue46198] Duplicated test name `test_get_unstructured_invalid_ew` in `test__header_value_parser.py`

2021-12-31 Thread Nikita Sobolev


Nikita Sobolev  added the comment:

Eric, should I patch this as well in this issue? 
Or should I open a new one? Would be happy to fix it :)

--

___
Python tracker 

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



[issue46198] Duplicated test name `test_get_unstructured_invalid_ew` in `test__header_value_parser.py`

2021-12-31 Thread Éric Araujo

Éric Araujo  added the comment:

Also fund a duplicate TestHelpers class in test_enum.

A warning for duplicate method is a false positive, because the two methods are 
used on different python versions.  But the first method uses `self.Grades.B` 
wrongly (should be `Grades.B`) so it will break when python 3.12 is started!

--
nosy: +eric.araujo

___
Python tracker 

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



[issue46198] Duplicated test name `test_get_unstructured_invalid_ew` in `test__header_value_parser.py`

2021-12-29 Thread Nikita Sobolev


Change by Nikita Sobolev :


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

___
Python tracker 

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



[issue46198] Duplicated test name `test_get_unstructured_invalid_ew` in `test__header_value_parser.py`

2021-12-29 Thread Nikita Sobolev


New submission from Nikita Sobolev :

There are two tests with the same name in a same test class in 
`Lib/test/test_email/test__header_value_parser.py`: 
`test_get_unstructured_invalid_ew`

1. 
https://github.com/python/cpython/blob/8e11237c5d24e649b26cc928b52bc37f2fde9c7a/Lib/test/test_email/test__header_value_parser.py#L304
2. 
https://github.com/python/cpython/blob/8e11237c5d24e649b26cc928b52bc37f2fde9c7a/Lib/test/test_email/test__header_value_parser.py#L398

So, because of this bad naming - the first test is always shadowed by the 
second one and is silently skipped. With my patch: 1660 tests, without: 1659 
tests.

PR to rename the second test is on its way.

--
components: Tests
messages: 409338
nosy: sobolevn
priority: normal
severity: normal
status: open
title: Duplicated test name `test_get_unstructured_invalid_ew` in 
`test__header_value_parser.py`
type: behavior
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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