jolly-good-toolbelt / sphinx_gherkindoc

A tool to convert Gherkin into Sphinx documentation
https://jolly-good-toolbelt.github.io/sphinx_gherkindoc/
11 stars 10 forks source link

Ensure filtering by tags works with Examples tables #48

Closed rbcasperson closed 2 years ago

rbcasperson commented 2 years ago

Fixes #47

See #47 for full details on the issue. Basically when filtering out Examples tables, we overwrite the attribute on the model class that we use for the scenario. That is fine for the Behave model class, but for the pytest-bdd model class, we use @property for examples, but we don't have a @examples.setter. We don't need to implement that setter, because pytest-bdd does not support tagging Examples tables, so they would never be filtered out. I chose instead to just only set that attribute if there something will be filtered, which most of the time if will not be.

Also, our test cases had a typo 😢

Also also, our test cases for this logic do not use the real models. They just use a bare minimum test data class: https://github.com/jolly-good-toolbelt/sphinx_gherkindoc/blob/master/tests/test_utils.py#L296-L308

So the failing case I ran into is not currently covered. I could take the time to set up the tests to properly use the real model classes, but I'm not sure it is worth it for these very edge cases. Though I'm happy to do it if so suggested. I'd just prefer it be a FF in that case.

rcasperson-jc commented 2 years ago

It seems that Travis is not triggering...