Skip to content

testscenarios support #263

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

Closed
pytestbot opened this issue Feb 12, 2013 · 10 comments
Closed

testscenarios support #263

pytestbot opened this issue Feb 12, 2013 · 10 comments
Labels
type: enhancement new feature or API change, should be merged into features branch

Comments

@pytestbot
Copy link
Contributor

Originally reported by: Ronny Pfannschmidt (BitBucket: RonnyPfannschmidt, GitHub: RonnyPfannschmidt)


testscenarios needs some special handling of the collection,
since its allowed to run multiple tests per TestCase.run unless one generates the scenarios


@pytestbot pytestbot added the type: enhancement new feature or API change, should be merged into features branch label Jun 15, 2015
@nicoddemus
Copy link
Member

Related to #916?

@RonnyPfannschmidt
Copy link
Member

perhaps in a different way tho, testscenarios is a unittest extension

@nicoddemus
Copy link
Member

Reference: testscenarios

@RonnyPfannschmidt
Copy link
Member

Closing as wish list item that got lost, implemented as a PR it would still be welcome

@bittner
Copy link

bittner commented Oct 3, 2016

How about adding the scenarios implementation (from the docs) to the py.test code base, so it could simply be imported? And rewrite the docs appropriately?

@nicoddemus
Copy link
Member

IMHO that would be perfect for an external plugin. A quick search found pytest-scenario, which might be useful already. 😁

@bittner
Copy link

bittner commented Oct 4, 2016

pytest-scenario is rather complex to use. IIUC, it requires an external JSON file. Which reminds me of:

If the implementation is hard to explain, it's a bad idea.

Or maybe I'm just not smart enough (anyway, the plugin is young). I'd rather prefer to include the scenarios with the test code, just like the example in the docs show. Ideally, I'd like to have a decorator on top of a scenarios definition. Kind of:

@pytest.parametrize(scenarios=[
    ('scenario-1', {'arg1_name': 'arg1-value', ...}),
    ...
])
class TestFooBar(object):
    ...

Even better, if we could put @pytest.parametrize(scenarios=...) on top of single functions, not only classes.

@RonnyPfannschmidt
Copy link
Member

@bittner at first glance, this looks exactly like parametrize just spelled in a different way

@nicoddemus
Copy link
Member

@bittner perhaps you can discuss this with the pytest-scenario author?

cc @OriMenashe

@bittner
Copy link

bittner commented Oct 10, 2016

@RonnyPfannschmidt Okay, I see. Thanks for the hint.

@nicoddemus I have tried to get in touch with the plugin author before via OriMenashe/pytest-scenario#2. Let's see how this develops.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement new feature or API change, should be merged into features branch
Projects
None yet
Development

No branches or pull requests

4 participants