Skip to content

added test for repr and test for default argument to constructor #565

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
merged 1 commit into from
Sep 2, 2021
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
16 changes: 16 additions & 0 deletions dpctl/tests/test_sycl_platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,19 @@ def check_print_info(platform):
pytest.fail("Encountered an exception inside print_info().")


def check_repr(platform):
r = repr(platform)
assert type(r) is str
assert r != ""


list_of_checks = [
check_name,
check_vendor,
check_version,
check_backend,
check_print_info,
check_repr,
]


Expand Down Expand Up @@ -118,6 +125,15 @@ def test_platform_creation(valid_filter, check):
check(platform)


def test_default_platform_creation(check):
platform = None
try:
platform = dpctl.SyclPlatform()
except ValueError:
pytest.skip("Failed to create default platform")
check(platform)


def test_invalid_platform_creation(invalid_filter, check):
"""Tests if we can create a SyclPlatform using a supported filter selector
string.
Expand Down