aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAlexander V. Chernikov <melifaro@FreeBSD.org>2023-01-25 13:55:33 +0000
committerAlexander V. Chernikov <melifaro@FreeBSD.org>2023-02-09 15:46:18 +0000
commitb821990ce6c7685dbd31edbc0e74d53a0fc05a9e (patch)
treeff668bed848647f0df527ec3d2dfc072fe833569 /tests
parent4a35f20563812b2d21784989651878e3a2d837d8 (diff)
downloadsrc-b821990ce6c7685dbd31edbc0e74d53a0fc05a9e.tar.gz
src-b821990ce6c7685dbd31edbc0e74d53a0fc05a9e.zip
pytest: add an example test fetching test directory and ATF vars.
MFC after: 2 weeks (cherry picked from commit 864ea9abfb98493a157dc17be17c428080843bdd)
Diffstat (limited to 'tests')
-rw-r--r--tests/examples/test_examples.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/examples/test_examples.py b/tests/examples/test_examples.py
index 13fdcc420f0e..fe9ae0a72cf2 100644
--- a/tests/examples/test_examples.py
+++ b/tests/examples/test_examples.py
@@ -50,6 +50,16 @@ class TestExampleSimple(BaseTest):
pass
@pytest.mark.skip(reason="comment me to run the test")
+ def test_get_properties(self, request):
+ """Shows fetching of test src dir and ATF-set variables"""
+ print()
+ print("SRC_DIR={}".format(request.fspath.dirname))
+ print("ATF VARS:")
+ for k, v in self.atf_vars.items():
+ print(" {}: {}".format(k, v))
+ print()
+
+ @pytest.mark.skip(reason="comment me to run the test")
@pytest.mark.require_user("unprivileged")
def test_syscall_failure(self):
s = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)