Skip to content
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

Fixes for gherkin reporter issues #263

Conversation

sliwinski-milosz
Copy link
Contributor

Related to:
#247
#235

This pull request updates --gherkin-terminal-reporter-expanded to enable gherkin output.
Thanks to that it can be used without adding --gherkin-terminal-reporter to the command.

This is the way suggested in the docs:
https://pytest-bdd.readthedocs.io/en/latest/#reporting

@coveralls
Copy link

coveralls commented Oct 29, 2018

Coverage Status

Coverage increased (+0.3%) to 93.712% when pulling d6fea08 on sliwinski-milosz:gherkin_expanded_option_improved into 5678a5c on pytest-dev:master.

@youtux
Copy link
Contributor

youtux commented Nov 1, 2018

@sliwinski-milosz Can you please add some tests for this? In case you need some input on how to test pytest plugins like pytest_bdd, you may want to check https://docs.pytest.org/en/latest/writing_plugins.html#testing-plugins.

Also, thank you very much for this PR.

@youtux
Copy link
Contributor

youtux commented Nov 1, 2018

Also, running pytest --gherkin-terminal-reporter-expanded tests on the pytest_bdd project itself results in an INTERNALERROR. Would you be interested to look into that?

@youtux youtux self-requested a review November 1, 2018 20:46
@sliwinski-milosz sliwinski-milosz force-pushed the gherkin_expanded_option_improved branch from bf5eec0 to f06f23c Compare November 15, 2018 11:27
@sliwinski-milosz
Copy link
Contributor Author

User can parametrize scenario by using examples specified in feature files. In that case pytest parametrize marker is updated with examples parameters.

We also provide a way to parametrize scenario on the python side by using pytest.mark.parametrize. https://pytest-bdd.readthedocs.io/en/latest/#combine-scenario-outline-and-pytest-parametrization

The problem with gherkin reporting is that when we are getting self.example_kwargs, we are using scenario.get_example_params() method that takes into account only args that are defined inside feature file (examples), and skips pytest.mark.parametrize parameters.

For gherkin reporting we need all parameters: those specified in feature files and those specified by using pytest.mark.parametrize decorator.

This pull requests uses parametrize marker to get all args.
It is ready for review.

This pull request contains three changes:

  1. It enables gherkin output by using only gherkin-terminal-reporter-expanded option
  2. It fixes issue mentioned above -> it gets all args for self.example_kwargs.
  3. It fixes issue with unicode step names (which caused INTERNALERROR during testing).

If that is too much I can split this pull request into three smaller ones.

@sliwinski-milosz
Copy link
Contributor Author

As this pull request got quite messy I decided to split it into three smaller pull requests to fix issues one by one:

  1. Let gherkin-terminal-reporter-expanded enable gherkin output #275
  2. Fixes #271: Use parametrize markers params for getting example_kwargs #272
  3. Fixes #273: Fix for unicode steps in gherkin reporter #274

@sliwinski-milosz sliwinski-milosz changed the title Let gherkin-terminal-reporter-expanded enable gherkin output Fixes for gherkin reporter issues Nov 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants