mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2025-12-24 02:39:20 -05:00
various little fixes
This commit is contained in:
@@ -1 +1,157 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><testsuites><testsuite name="pytest" errors="0" failures="0" skipped="0" tests="2" time="38.353" timestamp="2025-03-31T09:44:57.025358" hostname="vabene-pc"><testcase classname="cookbook.tests.other.test_recipe_full_text_search" name="test_search_count[found_recipe0-rating]" time="29.368" /><testcase classname="cookbook.tests.other.test_recipe_full_text_search" name="test_search_count[found_recipe1-timescooked]" time="29.371" /></testsuite></testsuites>
|
||||
<?xml version="1.0" encoding="utf-8"?><testsuites name="pytest tests"><testsuite name="pytest" errors="4" failures="0" skipped="0" tests="4" time="34.750" timestamp="2025-07-17T12:15:15.274960+02:00" hostname="DESKTOP-RM10LP5"><testcase classname="cookbook.tests.other.test_automations" name="test_never_unit_automation[arg0]" time="22.035"><error message="failed on setup with "TypeError: type 'Factory' is not subscriptable"">args = ()
|
||||
kwargs = {'request': <SubRequest 'space_1' for <Function test_never_unit_automation[arg0]>>}
|
||||
k = 'space_1__name'
|
||||
|
||||
@functools.wraps(fixture_function)
|
||||
def wrapper(*args: P.args, **kwargs: P.kwargs) -> T:
|
||||
for k in set(kwargs.keys()) - function_args:
|
||||
del kwargs[k]
|
||||
> return fixture_function(*args, **kwargs)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
..\..\..\venv\Lib\site-packages\pytest_factoryboy\fixturegen.py:88:
|
||||
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|
||||
..\..\..\venv\Lib\site-packages\pytest_factoryboy\fixturegen.py:49: in fn
|
||||
return function(*args, **kwargs)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|
||||
|
||||
request = <SubRequest 'space_1' for <Function test_never_unit_automation[arg0]>>
|
||||
factory_name = 'space_factory'
|
||||
|
||||
def model_fixture(request: SubRequest, factory_name: str) -> object:
|
||||
"""Model fixture implementation."""
|
||||
factoryboy_request: FactoryboyRequest = request.getfixturevalue("factoryboy_request")
|
||||
|
||||
# Try to evaluate as much post-generation dependencies as possible
|
||||
factoryboy_request.evaluate(request)
|
||||
|
||||
assert request.fixturename # NOTE: satisfy mypy
|
||||
fixture_name = request.fixturename
|
||||
prefix = "".join((fixture_name, SEPARATOR))
|
||||
|
||||
factory_class: type[Factory[object]] = request.getfixturevalue(factory_name)
|
||||
|
||||
# Create model fixture instance
|
||||
> NewFactory: type[Factory[object]] = cast(type[Factory[object]], type("Factory", (factory_class,), {}))
|
||||
^^^^^^^^^^^^^^^
|
||||
E TypeError: type 'Factory' is not subscriptable
|
||||
|
||||
..\..\..\venv\Lib\site-packages\pytest_factoryboy\fixture.py:360: TypeError</error></testcase><testcase classname="cookbook.tests.other.test_automations" name="test_never_unit_automation[arg2]" time="22.047"><error message="failed on setup with "TypeError: type 'Factory' is not subscriptable"">args = ()
|
||||
kwargs = {'request': <SubRequest 'space_1' for <Function test_never_unit_automation[arg2]>>}
|
||||
k = 'space_1__name'
|
||||
|
||||
@functools.wraps(fixture_function)
|
||||
def wrapper(*args: P.args, **kwargs: P.kwargs) -> T:
|
||||
for k in set(kwargs.keys()) - function_args:
|
||||
del kwargs[k]
|
||||
> return fixture_function(*args, **kwargs)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
..\..\..\venv\Lib\site-packages\pytest_factoryboy\fixturegen.py:88:
|
||||
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|
||||
..\..\..\venv\Lib\site-packages\pytest_factoryboy\fixturegen.py:49: in fn
|
||||
return function(*args, **kwargs)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|
||||
|
||||
request = <SubRequest 'space_1' for <Function test_never_unit_automation[arg2]>>
|
||||
factory_name = 'space_factory'
|
||||
|
||||
def model_fixture(request: SubRequest, factory_name: str) -> object:
|
||||
"""Model fixture implementation."""
|
||||
factoryboy_request: FactoryboyRequest = request.getfixturevalue("factoryboy_request")
|
||||
|
||||
# Try to evaluate as much post-generation dependencies as possible
|
||||
factoryboy_request.evaluate(request)
|
||||
|
||||
assert request.fixturename # NOTE: satisfy mypy
|
||||
fixture_name = request.fixturename
|
||||
prefix = "".join((fixture_name, SEPARATOR))
|
||||
|
||||
factory_class: type[Factory[object]] = request.getfixturevalue(factory_name)
|
||||
|
||||
# Create model fixture instance
|
||||
> NewFactory: type[Factory[object]] = cast(type[Factory[object]], type("Factory", (factory_class,), {}))
|
||||
^^^^^^^^^^^^^^^
|
||||
E TypeError: type 'Factory' is not subscriptable
|
||||
|
||||
..\..\..\venv\Lib\site-packages\pytest_factoryboy\fixture.py:360: TypeError</error></testcase><testcase classname="cookbook.tests.other.test_automations" name="test_never_unit_automation[arg3]" time="22.106"><error message="failed on setup with "TypeError: type 'Factory' is not subscriptable"">args = ()
|
||||
kwargs = {'request': <SubRequest 'space_1' for <Function test_never_unit_automation[arg3]>>}
|
||||
k = 'space_1__name'
|
||||
|
||||
@functools.wraps(fixture_function)
|
||||
def wrapper(*args: P.args, **kwargs: P.kwargs) -> T:
|
||||
for k in set(kwargs.keys()) - function_args:
|
||||
del kwargs[k]
|
||||
> return fixture_function(*args, **kwargs)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
..\..\..\venv\Lib\site-packages\pytest_factoryboy\fixturegen.py:88:
|
||||
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|
||||
..\..\..\venv\Lib\site-packages\pytest_factoryboy\fixturegen.py:49: in fn
|
||||
return function(*args, **kwargs)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|
||||
|
||||
request = <SubRequest 'space_1' for <Function test_never_unit_automation[arg3]>>
|
||||
factory_name = 'space_factory'
|
||||
|
||||
def model_fixture(request: SubRequest, factory_name: str) -> object:
|
||||
"""Model fixture implementation."""
|
||||
factoryboy_request: FactoryboyRequest = request.getfixturevalue("factoryboy_request")
|
||||
|
||||
# Try to evaluate as much post-generation dependencies as possible
|
||||
factoryboy_request.evaluate(request)
|
||||
|
||||
assert request.fixturename # NOTE: satisfy mypy
|
||||
fixture_name = request.fixturename
|
||||
prefix = "".join((fixture_name, SEPARATOR))
|
||||
|
||||
factory_class: type[Factory[object]] = request.getfixturevalue(factory_name)
|
||||
|
||||
# Create model fixture instance
|
||||
> NewFactory: type[Factory[object]] = cast(type[Factory[object]], type("Factory", (factory_class,), {}))
|
||||
^^^^^^^^^^^^^^^
|
||||
E TypeError: type 'Factory' is not subscriptable
|
||||
|
||||
..\..\..\venv\Lib\site-packages\pytest_factoryboy\fixture.py:360: TypeError</error></testcase><testcase classname="cookbook.tests.other.test_automations" name="test_never_unit_automation[arg1]" time="22.143"><error message="failed on setup with "TypeError: type 'Factory' is not subscriptable"">args = ()
|
||||
kwargs = {'request': <SubRequest 'space_1' for <Function test_never_unit_automation[arg1]>>}
|
||||
k = 'space_1__name'
|
||||
|
||||
@functools.wraps(fixture_function)
|
||||
def wrapper(*args: P.args, **kwargs: P.kwargs) -> T:
|
||||
for k in set(kwargs.keys()) - function_args:
|
||||
del kwargs[k]
|
||||
> return fixture_function(*args, **kwargs)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
..\..\..\venv\Lib\site-packages\pytest_factoryboy\fixturegen.py:88:
|
||||
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|
||||
..\..\..\venv\Lib\site-packages\pytest_factoryboy\fixturegen.py:49: in fn
|
||||
return function(*args, **kwargs)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|
||||
|
||||
request = <SubRequest 'space_1' for <Function test_never_unit_automation[arg1]>>
|
||||
factory_name = 'space_factory'
|
||||
|
||||
def model_fixture(request: SubRequest, factory_name: str) -> object:
|
||||
"""Model fixture implementation."""
|
||||
factoryboy_request: FactoryboyRequest = request.getfixturevalue("factoryboy_request")
|
||||
|
||||
# Try to evaluate as much post-generation dependencies as possible
|
||||
factoryboy_request.evaluate(request)
|
||||
|
||||
assert request.fixturename # NOTE: satisfy mypy
|
||||
fixture_name = request.fixturename
|
||||
prefix = "".join((fixture_name, SEPARATOR))
|
||||
|
||||
factory_class: type[Factory[object]] = request.getfixturevalue(factory_name)
|
||||
|
||||
# Create model fixture instance
|
||||
> NewFactory: type[Factory[object]] = cast(type[Factory[object]], type("Factory", (factory_class,), {}))
|
||||
^^^^^^^^^^^^^^^
|
||||
E TypeError: type 'Factory' is not subscriptable
|
||||
|
||||
..\..\..\venv\Lib\site-packages\pytest_factoryboy\fixture.py:360: TypeError</error></testcase></testsuite></testsuites>
|
||||
File diff suppressed because one or more lines are too long
@@ -91,7 +91,8 @@ def test_never_unit_automation(u1_s1, arg):
|
||||
|
||||
with scope(space=space):
|
||||
Automation.objects.get_or_create(name='never unit test', type=Automation.NEVER_UNIT, param_1='egg', param_2=arg[1], created_by=user, space=space)
|
||||
assert automation.apply_never_unit_automation(arg[0]) == arg[2]
|
||||
tokens, automation_applied = automation.apply_never_unit_automation(arg[0])
|
||||
assert tokens == arg[2]
|
||||
|
||||
|
||||
@pytest.mark.parametrize("source", [
|
||||
|
||||
Reference in New Issue
Block a user