Skip to content

Commit 71b9cee

Browse files
committed
pytest 4.0: fox nodeid parsing regex (see pytest-dev/pytest#4358)
1 parent 29addfc commit 71b9cee

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

pytest_csv/column/_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import re
2222
import six
2323

24-
__NODE_ID__ = re.compile(r'(?P<module>.+)\.py(?:::(?P<class>.+)::.+)?::(?P<function>[^\[]+)(?:\[(?P<params>.*)\])?')
24+
__NODE_ID__ = re.compile(r'(?P<module>.+)\.py(?:::(?P<class>[^:]+)(?:::.+)?)?::(?P<function>[^\[]+)(?:\[(?P<params>.*)\])?')
2525

2626

2727
def parse_node_id(node_id):

tests/test_classes.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,15 @@ def test_01(self):
2727
assert True
2828
''')
2929

30-
result = testdir.runpytest('--csv', 'tests.csv')
30+
result = testdir.runpytest('--csv', 'tests.csv',
31+
'--csv-columns', 'id,module,class,name,file,doc,markers,status,message,duration')
3132

3233
assert_outcomes(result, passed=1)
3334

3435
assert_csv_equal('tests.csv', [
35-
(ID, '.*test_in_class.py::TestClass::\(\)::test_01'),
36+
(ID, '.*test_in_class.py::TestClass.*::test_01'),
3637
(MODULE, r'.*test_in_class'),
38+
(CLASS, 'TestClass'),
3739
(NAME, 'test_01'),
3840
(FILE, r'.*test_in_class.py'),
3941
(DOC, ''),

0 commit comments

Comments
 (0)