Skip to content

helper__build_test_id is added (conftest refactoring) #229

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 18 additions & 16 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,22 @@ def timedelta_to_human_text(delta: datetime.timedelta) -> str:
# /////////////////////////////////////////////////////////////////////////////


def helper__build_test_id(item: pytest.Function) -> str:
assert item is not None
assert isinstance(item, pytest.Function)

testID = ""

if item.cls is not None:
testID = item.cls.__module__ + "." + item.cls.__name__ + "::"

testID = testID + item.name

return testID

# /////////////////////////////////////////////////////////////////////////////


def helper__makereport__setup(
item: pytest.Function, call: pytest.CallInfo, outcome: pluggy.Result
):
Expand All @@ -224,12 +240,7 @@ def helper__makereport__setup(
TEST_PROCESS_STATS.incrementNotExecutedTestCount()
return

testID = ""

if item.cls is not None:
testID = item.cls.__module__ + "." + item.cls.__name__ + "::"

testID = testID + item.name
testID = helper__build_test_id(item)

if rep.outcome == "passed":
testNumber = TEST_PROCESS_STATS.incrementExecutedTestCount()
Expand Down Expand Up @@ -279,12 +290,7 @@ def helper__makereport__call(
assert type(rep) == pytest.TestReport # noqa: E721

# --------
testID = ""

if item.cls is not None:
testID = item.cls.__module__ + "." + item.cls.__name__ + "::"

testID = testID + item.name
testID = helper__build_test_id(item)

# --------
assert call.start <= call.stop
Expand Down Expand Up @@ -394,10 +400,6 @@ def pytest_runtest_makereport(item: pytest.Function, call: pytest.CallInfo):
assert outcome is not None
assert type(outcome) == pluggy.Result # noqa: E721

rep: pytest.TestReport = outcome.get_result()
assert rep is not None
assert type(rep) == pytest.TestReport # noqa: E721

if call.when == "collect":
return

Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy