Permalink
Browse files

tests: check that the pytest plugin loads correctly and --help still …

…works

This should catch problems like the one fixed in #377.

Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
  • Loading branch information...
jluebbe authored and Emantor committed Jan 21, 2019
1 parent 46a68fc commit 58bcd1df252b2bc22d887790f15aeb1ac4eb81fa
Showing with 20 additions and 1 deletion.
  1. +20 −1 tests/test_fixtures.py
@@ -28,6 +28,13 @@ def test(env):
)
return t

def test_config(short_test):
with pexpect.spawn('pytest --traceconfig {}'.format(short_test)) as spawn:
spawn.expect(pexpect.EOF)
assert b'labgrid.pytestplugin' in spawn.before
spawn.close()
assert spawn.exitstatus == 0

def test_env_fixture(short_env, short_test):
with pexpect.spawn('pytest --lg-env {} {}'.format(short_env,short_test)) as spawn:
spawn.expect(pexpect.EOF)
@@ -55,5 +62,17 @@ def test_env_with_junit(short_env, short_test, tmpdir):
with pexpect.spawn('pytest --junitxml={} --env-config {} {}'.format(x,short_env,short_test)) as spawn:
spawn.expect(pexpect.EOF)
spawn.close()
print(spawn.before)
assert spawn.exitstatus == 0

def test_help(short_test):
with pexpect.spawn('pytest --help {}'.format(short_test)) as spawn:
spawn.expect(pexpect.EOF)
assert b'--lg-coordinator=CROSSBAR_URL' in spawn.before
spawn.close()
assert spawn.exitstatus == 0

def test_help_coordinator(short_test):
with pexpect.spawn('pytest --lg-coordinator=ws://127.0.0.1:20408/ws --help {}'.format(short_test)) as spawn:
spawn.expect(pexpect.EOF)
spawn.close()
assert spawn.exitstatus == 0

0 comments on commit 58bcd1d

Please sign in to comment.