From d37413deeeccb92e2710c96611624917fb4cc4b8 Mon Sep 17 00:00:00 2001 From: Michael Boulton Date: Sat, 30 Jul 2022 15:04:11 +0100 Subject: [PATCH] Fix rebase --- scripts/smoke.bash | 4 ++- tavern/core.py | 1 - tavern/request/base.py | 11 ++------ tests/integration/test_fixtures.tavern.yaml | 31 --------------------- tests/integration/test_tincture.tavern.yaml | 29 +++++++++++++++++++ tox.ini | 2 +- 6 files changed, 36 insertions(+), 42 deletions(-) create mode 100644 tests/integration/test_tincture.tavern.yaml diff --git a/scripts/smoke.bash b/scripts/smoke.bash index e05068dc..852f028b 100755 --- a/scripts/smoke.bash +++ b/scripts/smoke.bash @@ -5,7 +5,9 @@ set -ex PYVER=39 tox -c tox.ini \ - -e py${PYVER}flakes \ + -e py${PYVER}flakes + +tox -c tox.ini \ -e py${PYVER} \ -e py${PYVER}-pytest6 \ -e py${PYVER}black \ diff --git a/tavern/core.py b/tavern/core.py index c818325b..9099138b 100644 --- a/tavern/core.py +++ b/tavern/core.py @@ -245,7 +245,6 @@ def run_stage(sessions, stage, test_block_config): test_block_config (dict): available variables for test """ stage = copy.deepcopy(stage) - name = stage["name"] attach_stage_content(stage) diff --git a/tavern/request/base.py b/tavern/request/base.py index 427a45da..7f49ace5 100644 --- a/tavern/request/base.py +++ b/tavern/request/base.py @@ -1,15 +1,15 @@ from abc import abstractmethod import logging -logger = logging.getLogger(__name__) - from box import Box +logger = logging.getLogger(__name__) + class BaseRequest(object): @property @abstractmethod - def request_vars(self): + def request_vars(self) -> Box: """ Variables used in the request @@ -22,8 +22,3 @@ def request_vars(self): @abstractmethod def run(self): """Run test""" - - @property - @abstractmethod - def request_vars(self) -> Box: - """Get any extra variables used for this request""" diff --git a/tests/integration/test_fixtures.tavern.yaml b/tests/integration/test_fixtures.tavern.yaml index 440585f5..adddde1e 100644 --- a/tests/integration/test_fixtures.tavern.yaml +++ b/tests/integration/test_fixtures.tavern.yaml @@ -140,34 +140,3 @@ stages: status_code: 200 json: value: "{autouse_thing_named}" - ---- - -test_name: Test tincture - -includes: - - !include common.yaml - -marks: - - usefixtures: - - yielder - - str_fixture - - yield_str_fixture - -stages: - - name: do something - tinctures: - - function: tavern.testutils.helpers:time_request - - function: tavern.testutils.helpers:print_response - extra_kwargs: - extra_print: "blooble" - request: - url: "{host}/echo" - method: POST - json: - value: "{str_fixture}" - response: - status_code: 200 - json: - value: "{yield_str_fixture}" - f: gf diff --git a/tests/integration/test_tincture.tavern.yaml b/tests/integration/test_tincture.tavern.yaml new file mode 100644 index 00000000..c91fa573 --- /dev/null +++ b/tests/integration/test_tincture.tavern.yaml @@ -0,0 +1,29 @@ +--- + +test_name: Test tincture + +includes: +- !include common.yaml + +marks: +- usefixtures: + - yielder + - str_fixture + - yield_str_fixture + +stages: +- name: do something + tinctures: + - function: tavern.testutils.helpers:time_request + - function: tavern.testutils.helpers:print_response + extra_kwargs: + extra_print: "blooble" + request: + url: "{host}/echo" + method: POST + json: + value: "{str_fixture}" + response: + status_code: 200 + json: + value: "{yield_str_fixture}" diff --git a/tox.ini b/tox.ini index f1a165fb..e5589dc4 100644 --- a/tox.ini +++ b/tox.ini @@ -11,7 +11,7 @@ commands = [testenv:py39lint] basepython = python3.9 commands = - pylint tavern/ -j 4 + pylint tavern/ -j 0 [testenv:py39flakes] skip_install = true