Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit712de46

Browse files
helper__build_test_id is added (conftest refactoring) (#229)
1 parentca54589 commit712de46

File tree

1 file changed

+18
-12
lines changed

1 file changed

+18
-12
lines changed

‎tests/conftest.py

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,22 @@ def timedelta_to_human_text(delta: datetime.timedelta) -> str:
199199
# /////////////////////////////////////////////////////////////////////////////
200200

201201

202+
defhelper__build_test_id(item:pytest.Function)->str:
203+
assertitemisnotNone
204+
assertisinstance(item,pytest.Function)
205+
206+
testID=""
207+
208+
ifitem.clsisnotNone:
209+
testID=item.cls.__module__+"."+item.cls.__name__+"::"
210+
211+
testID=testID+item.name
212+
213+
returntestID
214+
215+
# /////////////////////////////////////////////////////////////////////////////
216+
217+
202218
defhelper__makereport__setup(
203219
item:pytest.Function,call:pytest.CallInfo,outcome:pluggy.Result
204220
):
@@ -224,12 +240,7 @@ def helper__makereport__setup(
224240
TEST_PROCESS_STATS.incrementNotExecutedTestCount()
225241
return
226242

227-
testID=""
228-
229-
ifitem.clsisnotNone:
230-
testID=item.cls.__module__+"."+item.cls.__name__+"::"
231-
232-
testID=testID+item.name
243+
testID=helper__build_test_id(item)
233244

234245
ifrep.outcome=="passed":
235246
testNumber=TEST_PROCESS_STATS.incrementExecutedTestCount()
@@ -279,12 +290,7 @@ def helper__makereport__call(
279290
asserttype(rep)==pytest.TestReport# noqa: E721
280291

281292
# --------
282-
testID=""
283-
284-
ifitem.clsisnotNone:
285-
testID=item.cls.__module__+"."+item.cls.__name__+"::"
286-
287-
testID=testID+item.name
293+
testID=helper__build_test_id(item)
288294

289295
# --------
290296
assertcall.start<=call.stop

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp