Using data held by Sphinx to generate something is a job for a sphinx 
Builder.  I don't think that the amount of work to do this will be a good 
choice for your use-case.

Here are two alternatives:

*use Sphinx normally*

class myTestCase1(aetest.Testcase):
  '''Ask 100 people if spiderman is cool

  The purpose of this test is to check whether spiderman is cool.

  At least 51 people think that spiderman is cool

  Please refer to <LINK>
  '''
Then build a HTML page with these.

*Use class attributes*

class myTestCase1(aetest.Testcase):  
  test_purpose = "The purpose of this test is to check whether spiderman is 
cool."
  test_environment = "Please refer to <LINK>"
  test_description = "Ask 100 people if spiderman is cool"
  test-expected-results = "At least 51 people think that spiderman is cool"
 
The get these values an pass them to a jinja template.
On Friday, March 18, 2022 at 6:07:46 AM UTC-4 jolu...@googlemail.com wrote:

> Hi sphinx-users,
> maybe I have a weird requirements or more like a question whether the 
> following is possible using sphinx.
> I'm using Python code to define testcases using a predefined testing 
> framework (pyATS).
>
> So within this framework, test cases are defined as Python classes with 
> multiple test steps as methods within this class. Example
>
> class myTestCase1(aetest.Testcase):
>   @aetest.test
>   def myTestStep1(self):
>      #... Test code
>   @aetest.test
>   def myTestStep2(self):
>      #... Test code
> class myTestCase2(aetest.Testcase): 
> # ...
>
> So I don't really need to document classes in the usual way, because there 
> are no arguments etc. It's more like a container class.
>
> What I like to achive is a "human readable" Test Case documentation from 
> the code.
> If using the example from above:
> class myTestCase1(aetest.Testcase):
>   ''' myTestCase1
>   :test-purpose: The purpose of this test is to check whether spiderman is 
> cool.
>   :test-environment: Please refer to <LINK>
>   :test-description: Ask 100 people if spiderman is cool
>   :test-expected-results: At least 51 people think that spiderman is cool
>   '''
>   @aetest.test
>   def myTestStep1(self):
>      #... Test code
>   @aetest.test
>   def myTestStep2(self):
>      #... Test code
> class myTestCase2(aetest.Testcase): 
> # ...
>
> Hope you get the point... So I want to generate a document (preferably a 
> markdown document) based on a jinja2 template, where I can access the 
> definitions from above like :test-description: 
>
> Is something like this achivable using sphinx?
>

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sphinx-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sphinx-users/a81a54b2-6f74-4c10-86f9-db18928d6948n%40googlegroups.com.

Reply via email to