mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PY-23856: Support tests with docstring and spaces in target
* Targets are trimmed * When unittest reports test with docstring it should be part of name, but not location
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
def test_evens():
|
||||
for i in range(0, 5):
|
||||
yield check_even, i, i*3
|
||||
|
||||
def check_even(n, nn):
|
||||
assert n % 2 == 0 or nn % 2 == 0
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
import pytest
|
||||
@pytest.mark.parametrize("test_input,expected", [
|
||||
("three plus file", 8),
|
||||
("(2)+(4)", 6),
|
||||
(" six times nine.", 42),
|
||||
])
|
||||
def test_eval(test_input, expected):
|
||||
assert eval(test_input) == expected
|
||||
@@ -0,0 +1,10 @@
|
||||
from unittest import TestCase
|
||||
|
||||
class SomeTestCase(TestCase):
|
||||
def testSomething(self):
|
||||
""" Only with docstring test is parsed with extra space"""
|
||||
self.assertEqual(1 + 1, 2)
|
||||
|
||||
def testSomethingBad(self):
|
||||
"""Fail"""
|
||||
self.assertEqual(1 + 1, 3)
|
||||
Reference in New Issue
Block a user