Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Jan 2023 13:57:25 GMT
From:      "Alexander V. Chernikov" <melifaro@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 864ea9abfb98 - main - pytest: add an example test fetching test directory and ATF vars.
Message-ID:  <202301251357.30PDvPwG042647@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by melifaro:

URL: https://cgit.FreeBSD.org/src/commit/?id=864ea9abfb98493a157dc17be17c428080843bdd

commit 864ea9abfb98493a157dc17be17c428080843bdd
Author:     Alexander V. Chernikov <melifaro@FreeBSD.org>
AuthorDate: 2023-01-25 13:55:33 +0000
Commit:     Alexander V. Chernikov <melifaro@FreeBSD.org>
CommitDate: 2023-01-25 13:55:33 +0000

    pytest: add an example test fetching test directory and ATF vars.
    
    MFC after:      2 weeks
---
 tests/examples/test_examples.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

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
@@ -49,6 +49,16 @@ class TestExampleSimple(BaseTest):
     def test_two(self):
         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):



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202301251357.30PDvPwG042647>