-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: test_suite() missing 2 required positional arguments: '________step_name_' and 'request' #40
Comments
When I am try pytest test_my_1111.py --html=4444444444.html pytest test_my_1111.py --html=4444444444.html test_my_1111.py FF ================================================================================================== FAILURES ================================================================================================== self = <examples.test_my_1111.MMMM testMethod=test_my_12345>
E AssertionError: assert False test_my_1111.py:32: AssertionError self = <unittest.case._Outcome object at 0x7f13e196ec18>, test_case = <examples.test_my_1111.MMMM testMethod=test_suite>, isTest = True
/usr/lib/python3.6/unittest/case.py:59: self = <examples.test_my_1111.MMMM testMethod=test_suite>, result =
E TypeError: test_suite() missing 2 required positional arguments: '_______step_name' and 'request' /usr/lib/python3.6/unittest/case.py:605: TypeError |
Hi @IvanHrytskiv , thanks for reaching out ! Does the bug appear when you run this outside of selenium, but still in a class ? I'm trying to figure out if this due to a conflict with the selenium framework, or to the fact that this is a test method inside a class (and not a module-level function) What |
Hi !
Does the bug appear when you run this outside of selenium, but still in a
class ? = YES
пн, 4 січ. 2021 о 17:43 Sylvain Marié <[email protected]> пише:
… Hi @IvanHrytskiv <https://github.com/IvanHrytskiv> , thanks for reaching
out !
Does the bug appear when you run this outside of selenium, but still in a
class ? I'm trying to figure out if this due to a conflict with the
selenium framework, or to the fact that this is a test method inside a
class (and not a module-level function)
What @test_steps does is that it wraps your function with a test function
that requires two new arguments ('_______step_name' and 'request', as can
be seen in the stack trace). The first is a parameter injected with a
generated @parametrize if I remember well, and the second is the
traditional fixture from pytest. So both should be injected by pytest in
the end.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#40 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABXSBTJVP57PP5CABYGFCC3SYHO2RANCNFSM4VF2VMOQ>
.
|
I'm sorry but I cant' reproduce the error on my side. The following code works correctly: from pytest_steps import test_steps
class TestClass:
@test_steps('step_a', 'step_b', 'step_c')
def test_suite(self):
# Step A
print("step a")
assert not False # replace with your logic
intermediate_a = 'hello'
yield
# Step B
print("step b")
assert not False # replace with your logic
yield
# Step C
print("step c")
new_text = intermediate_a + " ... augmented"
print(new_text)
assert len(new_text) == 19
yield Do you confirm ? |
TestClass(BaseCkass) - don't work for me(((
вт, 5 січ. 2021, 10:28 користувач Sylvain Marié <[email protected]>
пише:
… I'm sorry but I cant' reproduce the error on my side. The following code
works correctly:
from pytest_steps import test_steps
class TestClass:
@test_steps('step_a', 'step_b', 'step_c')
def test_suite(self):
# Step A
print("step a")
assert not False # replace with your logic
intermediate_a = 'hello'
yield
# Step B
print("step b")
assert not False # replace with your logic
yield
# Step C
print("step c")
new_text = intermediate_a + " ... augmented"
print(new_text)
assert len(new_text) == 19
yield
Do you confirm ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#40 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABXSBTLYWD6UUPDPCRUZDI3SYLEUHANCNFSM4VF2VMOQ>
.
|
So this is an issue with |
Cool, thanks!
вт, 5 січ. 2021, 13:26 користувач Sylvain Marié <[email protected]>
пише:
… So this is an issue with seleniumbase apparently. I opened an issue
there: seleniumbase/SeleniumBase#772
<seleniumbase/SeleniumBase#772>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#40 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABXSBTLK3DHTZQTWHMVYICTSYLZPBANCNFSM4VF2VMOQ>
.
|
@IvanHrytskiv , @smarie See: seleniumbase/SeleniumBase#772 (comment) |
So @IvanHrytskiv the following should work: from pytest_steps import test_steps
class TestMMMM():
@test_steps('step_a', 'step_b', 'step_c')
def test_suite(self, sb):
# Step A
print("step a")
assert not False # replace with your logic
intermediate_a = 'hello'
yield
# Step B
print("step b")
assert not False # replace with your logic
yield
# Step C
print("step c")
new_text = intermediate_a + " ... augmented"
print(new_text)
assert len(new_text) == 19
yield Note the added |
Thanks !!!!)))) |
The class line may need to be |
I updated the example, thanks @mdmintz ! @IvanHrytskiv I close this ticket since it seems to solve the issue on your side. If this is not the case feel free to reopen. Thanks again for contributing ! |
Cool, thanks! Fast and perfect job !
The Best Regards, Ivan.
вт, 5 січ. 2021, 23:34 користувач Sylvain Marié <[email protected]>
пише:
… Closed #40 <#40>.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#40 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABXSBTL37H2J4UAUCZLATEDSYOAWTANCNFSM4VF2VMOQ>
.
|
H!
I still have a question so as not to get into an unresolved situation again:
How can I use celery in seleniumbase and pytest_steps ?
And another question: How do you recommend from the front end from the web
interface to run, for example, pytests with different parameters,
as well as to specify for celery a schedule for running specific tests?
Thanks !
The Best Regards, Ivan
ср, 6 січ. 2021 о 00:31 Sunsey <[email protected]> пише:
… Cool, thanks! Fast and perfect job !
The Best Regards, Ivan.
вт, 5 січ. 2021, 23:34 користувач Sylvain Marié ***@***.***>
пише:
> Closed #40 <#40>.
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#40 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ABXSBTL37H2J4UAUCZLATEDSYOAWTANCNFSM4VF2VMOQ>
> .
>
|
Hi @IvanHrytskiv , unfortunately I have no experience with celery nor selenium :( |
from pytest_steps import test_steps
from seleniumbase import BaseCase
class MMMM(BaseCase):
The text was updated successfully, but these errors were encountered: