Skip to content

Commit

Permalink
ci: Fix Python rz-pipe test step (#59)
Browse files Browse the repository at this point in the history
* Don't ignore errors
* Use pytest 8.3.3
* Remove rz-agent use from open_base_test.py test
  • Loading branch information
kazarmy authored Nov 11, 2024
1 parent fa74cca commit 3b2fb66
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 31 deletions.
2 changes: 1 addition & 1 deletion python/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ twine:

pytest:
@echo "Running the pytest"
-PYTHONPATH=$$PWD $(PYTHON) -m pytest -p no:cacheprovider tests/
PYTHONPATH=$$PWD $(PYTHON) -m pytest -p no:cacheprovider tests/

test: test2 test3

Expand Down
2 changes: 1 addition & 1 deletion python/requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
pytest==6.2.2
pytest==8.3.3
black==20.8b1
2 changes: 1 addition & 1 deletion python/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pytest==6.2.2
pytest==8.3.3
30 changes: 2 additions & 28 deletions python/tests/open_base_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import contextlib
import os
import sys
from shutil import which

Expand All @@ -8,29 +6,6 @@
from rzpipe import open_base


def kill(process_name):
os.system(f"pkill {process_name}") == 0 or \
os.system(f"killall {process_name}") == 0 or \
os.system(f"taskkill /f /im {process_name}") == 0 or \
os.system(f"taskkill /f /im {process_name}.exe") == 0


def setup(port: int = 9080):
kill("rz-agent")
os.system(f"rz-agent -p{port} -d")


def tear_down():
kill("rz-agent")


@contextlib.contextmanager
def linux_test():
setup()
yield
tear_down()


def test_constructor_win():
if sys.platform.startswith("nt"):
pytest.skip("skipping windows-only tests")
Expand All @@ -46,6 +21,5 @@ def test_constructor_linux():
"""
if sys.platform.startswith("win"):
pytest.skip("skipping linux-only tests")
with linux_test():
with open_base.OpenBase("http://localhost:9080") as base:
base.cmd(f"o {which('/bin/ls')}")
with open_base.OpenBase(which('ls')) as base:
base.cmd("s entry0; pd 20")

0 comments on commit 3b2fb66

Please sign in to comment.