Skip to content

Commit

Permalink
1.6.1 Made the python 3 signature patch more readable... for those us…
Browse files Browse the repository at this point in the history
…ers who will enter in the code while debugging.
  • Loading branch information
Sylvain MARIE committed Mar 15, 2019
1 parent 41d09d1 commit 55334da
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 20 deletions.
4 changes: 4 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

### 1.6.1 - Minor code improvements

Made the python 3 signature patch more readable... for those users who will enter in the code while debugging.

### 1.6.0 - Minor dependencies update

Improved docstring for `@cross_steps_fixture`.
Expand Down
16 changes: 4 additions & 12 deletions pytest_steps/steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,10 @@

# Python 3+: load the 'more explicit api' for `test_steps`
if version_info >= (3, 0):

test_steps_full_sig = """
def _test_steps(*steps,
mode: str = TEST_STEP_MODE_AUTO,
test_step_argname: str = TEST_STEP_ARGNAME_DEFAULT,
steps_data_holder_name: str = STEPS_DATA_HOLDER_NAME_DEFAULT):
pass
"""
exec(test_steps_full_sig, globals(), locals())
_test_steps = locals()['_test_steps']
new_sig = signature(_test_steps)
new_sig = """(*steps,
mode: str = TEST_STEP_MODE_AUTO,
test_step_argname: str = TEST_STEP_ARGNAME_DEFAULT,
steps_data_holder_name: str = STEPS_DATA_HOLDER_NAME_DEFAULT)"""
else:
new_sig = None

Expand Down
10 changes: 2 additions & 8 deletions pytest_steps/steps_parametrizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,14 +235,8 @@ def _execute_manually(test_func, s, test_step_argname, all_step_ids, all_steps,

# Python 3+: load the 'more explicit api' for `test_steps`
if version_info >= (3, 0):
depends_on_full_sig = """
def _depends_on(*steps,
fail_instead_of_skip: bool = _FAIL_INSTEAD_OF_SKIP_DEFAULT):
pass
"""
exec(depends_on_full_sig, globals(), locals())
_depends_on = locals()['_depends_on']
new_sig = signature(_depends_on)
new_sig = """(*steps,
fail_instead_of_skip: bool = _FAIL_INSTEAD_OF_SKIP_DEFAULT)"""
else:
new_sig = None

Expand Down

0 comments on commit 55334da

Please sign in to comment.