Skip to content

Commit c2d64de

Browse files
committed
NO MERGE: coverage test
Signed-off-by: Liam Brady <[email protected]>
1 parent b904607 commit c2d64de

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ test: test-validate ci-lint
4343
sudo -E $(POETRYRUN) mutest tests
4444
sudo -E $(POETRYRUN) pytest -s -v --cov=munet --cov-report=xml tests
4545

46+
unit-test:
47+
sudo -E $(POETRYRUN) pytest -s -v --cov=munet --cov-report=xml tests/conftest.py tests/control/test_spawn.py
48+
4649
clean:
4750
rm -f *.yang coverage.xml err.out ox-rfc.el
4851
rm -rf .testtmp/schema

munet/base.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,12 @@ async def spawn(
682682

683683
self.logger.debug("%s: expecting: %s", self, patterns)
684684

685+
if p.fileno() == -1:
686+
# XXX PopenSpawn's lack of file descriptor (p.fileno()) causes error
687+
# with expect() only when async_=True is set. Is this an upstream issue?
688+
logging.error("pexpect.popen_spawn.PopenSpawn causes asyncio errors")
689+
assert False
690+
685691
while index := await p.expect(patterns, async_=True):
686692
if trace:
687693
assert p.match is not None

tests/control/test_spawn.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ async def test_spawn(unet_share, host, mode, shellcmd):
5757
unet = unet_share
5858
if not os.path.exists(shellcmd):
5959
pytest.skip(f"{shellcmd} not installed skipping")
60+
if host == "remote1" and mode == "piped":
61+
pytest.skip("Skipping due to asyncio issues")
6062

6163
os.environ["TEST_SHELL"] = shellcmd
6264

0 commit comments

Comments
 (0)