Skip to content

Commit

Permalink
Fix known_sytem function and check in tests (#485)
Browse files Browse the repository at this point in the history
* Fix known_sytem function and check in tests
- Pass the correct object to _guess_platform
- Add Arch into the platforms namespace
  • Loading branch information
itziakos authored Feb 6, 2025
1 parent 3114ea4 commit c17dd96
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions okonomiyaki/platforms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
from .abi import PlatformABI, default_abi
from .epd_platform import EPDPlatform, applies
from ._platform import Platform, OSKind, FamilyKind, NameKind
from ._arch import X86, X86_64, ARM64
from ._arch import X86, X86_64, ARM64, Arch
from .pep425 import compute_abi_tag, compute_python_tag, compute_platform_tag
from .python_implementation import PythonABI, PythonImplementation


__all__ = [
'X86', 'X86_64', 'ARM64', 'EPDPlatform', 'Platform', 'PythonImplementation',
'default_abi'
'default_abi','Arch'
]
2 changes: 1 addition & 1 deletion okonomiyaki/runtimes/tests/test_runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
class TestPythonRuntime(unittest.TestCase):

@unittest.skipIf(
not known_system,
not known_system(),
'This test should be executed only on Enthought supported platforms')
def test_simple_from_running_python(self):
# When
Expand Down
9 changes: 5 additions & 4 deletions okonomiyaki/utils/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,13 @@ def __exit__(self, *a, **kw):
patcher.__exit__(*a, **kw)


def known_system(self):
from okonomiyaki.plarforms._platform import (
_guess_os_kind, _guess_platform, _guess_platform_details)
def known_system():
from okonomiyaki.platforms import Arch
from okonomiyaki.platforms._platform import (
_guess_os_kind, _guess_platform_details)
try:
Arch.from_running_system()
os_kind = _guess_os_kind()
_guess_platform(os_kind)
_guess_platform_details(os_kind)
except OkonomiyakiError:
return False
Expand Down

0 comments on commit c17dd96

Please sign in to comment.