Skip to content

pombredanne/slash-step

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

slash_step

Create a more granular sub STEP for Slash tests.

Some scenarios can be long and complex, but you still want to have them as a single logical test. Steps allow to document subsections of a test, and also provide some handy hooks to perform actions inside a test (such as validations).

To continue the microwave example from Slash's docs:

from slash import Test, g
from slash_step import STEP, hooks

@hooks.step_end.register
def measure_temperature():
    if g.microwave.temperature > 180:
        logger.warn("Microwave is over heating!")
    
class MicrowaveTest(Test):
    def test_cook_chicken(self):
        with STEP("Defrost chicken"):
            # ...
        with STEP("Cook"):
            # ...
        with STEP("Eat"):
            # Yum...
            self.assertTrue(g.chicken.is_cooked())

About

Create a more granular sub STEP for slash tests.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%