git: b821990ce6c7 - stable/13 - pytest: add an example test fetching test directory and ATF vars.

From: Alexander V. Chernikov <melifaro_at_FreeBSD.org>
Date: Thu, 09 Feb 2023 16:11:24 UTC
The branch stable/13 has been updated by melifaro:

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

commit b821990ce6c7685dbd31edbc0e74d53a0fc05a9e
Author:     Alexander V. Chernikov <melifaro@FreeBSD.org>
AuthorDate: 2023-01-25 13:55:33 +0000
Commit:     Alexander V. Chernikov <melifaro@FreeBSD.org>
CommitDate: 2023-02-09 15:46:18 +0000

    pytest: add an example test fetching test directory and ATF vars.
    
    MFC after:      2 weeks
    
    (cherry picked from commit 864ea9abfb98493a157dc17be17c428080843bdd)
---
 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):