Skip to content

Commit ac148fc

Browse files
Merge pull request #129 from elchupanebrej/feature/doc_alabaster_mobile
Feature/doc alabaster mobile
2 parents 0046800 + 8149724 commit ac148fc

File tree

89 files changed

+5081
-2119
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+5081
-2119
lines changed

.github/workflows/main.yml

+2
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ jobs:
5050
uses: actions/setup-node@v4
5151
with:
5252
node-version: "*"
53+
- name: Install pandoc
54+
uses: r-lib/actions/setup-pandoc@v2
5355
- name: Install PyPi dependencies
5456
run: |
5557
python -m pip install --upgrade pip

.github/workflows/release.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ jobs:
1616
- uses: actions/setup-python@v5
1717
with:
1818
python-version: "3.13"
19+
- name: Install pandoc
20+
uses: r-lib/actions/setup-pandoc@v2
1921
- name: Install dependencies
2022
run: |
2123
python -m pip install --upgrade pip build twine

.pre-commit-config.yaml

+11-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# See https://pre-commit.com for more information
22
# See https://pre-commit.com/hooks.html for more hooks
33
---
4+
default_language_version:
5+
python: python3.12
46
repos:
57
- repo: https://github.com/psf/black
68
rev: 24.10.0
@@ -19,7 +21,9 @@ repos:
1921
rev: v5.0.0
2022
hooks:
2123
- id: trailing-whitespace
24+
exclude: "^.*\\.rst$"
2225
- id: end-of-file-fixer
26+
exclude: "^.*\\.rst$"
2327
- id: check-yaml
2428
- id: check-added-large-files
2529
- id: check-toml
@@ -56,10 +60,13 @@ repos:
5660
- id: generate-feature-doc
5761
name: generate-feature-doc
5862
entry: >
59-
python src/pytest_bdd/script/bdd_tree_to_rst.py
60-
features
61-
docs/features.rst
63+
python src/pytest_bdd/script/bdd_tree_to_rst.py features docs/features
6264
language: python
6365
types: [python]
6466
pass_filenames: false
65-
additional_dependencies: ['docopt-ng']
67+
additional_dependencies:
68+
- 'docopt-ng'
69+
- 'pandoc'
70+
- 'panflute'
71+
- 'pycmarkgfm'
72+
- 'pypandoc'

docs/conf.py

+3
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@
131131
# relative to this directory. They are copied after the builtin static files,
132132
# so a file named "default.css" will overwrite the builtin "default.css".
133133
html_static_path = ["_static"]
134+
html_css_files = [
135+
"css/custom.css",
136+
]
134137

135138
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
136139
# using the given strftime format.

docs/features.rst

-173
This file was deleted.

docs/features/Feature/Description.feature.rst

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
Feature: Descriptions
2+
^^^^^^^^^^^^^^^^^^^^^
3+
4+
Free-form descriptions can be placed underneath Feature,
5+
Example/Scenario, Background, Scenario Outline and Rule. You can write
6+
anything you like, as long as no line starts with a keyword.
7+
Descriptions can be in the form of Markdown - formatters including the
8+
official HTML formatter support this.
9+
10+
Scenario:
11+
'''''''''
12+
13+
- Given File "Description.feature" with content:
14+
15+
.. code:: gherkin
16+
17+
Feature:
18+
My Feature description
19+
Scenario:
20+
Given I check feature description
21+
22+
- And File "conftest.py" with content:
23+
24+
.. code:: python
25+
26+
from pytest_bdd import given
27+
28+
@given('I check feature description')
29+
def step(feature):
30+
assert feature.description == "My Feature description"
31+
32+
- When run pytest
33+
34+
- Then pytest outcome must contain tests with statuses:
35+
36+
====== ======
37+
passed failed
38+
====== ======
39+
1 0
40+
====== ======

docs/features/Feature/Load/Autoload.feature.rst

+96
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
Feature: Gherkin features autoload
2+
''''''''''''''''''''''''''''''''''
3+
4+
By default gherkin features are autoloaded and treated as usual pytest
5+
tests if are placed in the tests hierarchy proposed by pytest. This
6+
behavior could be disabled
7+
8+
Rule: Feature autoload
9+
10+
11+
Background:
12+
13+
14+
- Given File "Passing.feature" with content:
15+
16+
.. code:: gherkin
17+
18+
Feature: Passing feature
19+
Scenario: Passing scenario
20+
* Passing step
21+
22+
- Given File "Another.passing.feature.md" with content:
23+
24+
.. code:: markdown
25+
26+
# Feature: Passing feature
27+
## Scenario: Passing scenario
28+
* Given Passing step
29+
30+
- Given Install npm packages
31+
32+
======== =================
33+
packages @cucumber/gherkin
34+
======== =================
35+
======== =================
36+
37+
- Given File "conftest.py" with content:
38+
39+
.. code:: python
40+
41+
from pytest_bdd import step
42+
43+
@step('Passing step')
44+
45+
def _():
46+
...
47+
48+
Scenario: Feature is loaded by default
49+
50+
51+
- When run pytest
52+
- Then pytest outcome must contain tests with statuses:
53+
54+
+--------+
55+
| passed |
56+
+========+
57+
| 2 |
58+
+--------+
59+
60+
Scenario: Feature autoload could be disabled via command line
61+
62+
63+
- When run pytest
64+
65+
======== ==========================
66+
cli_args --disable-feature-autoload
67+
======== ==========================
68+
======== ==========================
69+
70+
- Then pytest outcome must contain tests with statuses:
71+
72+
+--------+
73+
| passed |
74+
+========+
75+
| 0 |
76+
+--------+
77+
78+
Scenario: Feature autoload could be disabled via pytest.ini
79+
80+
81+
- Given Set pytest.ini content to:
82+
83+
.. code:: ini
84+
85+
[pytest]
86+
disable_feature_autoload=true
87+
88+
- When run pytest
89+
90+
- Then pytest outcome must contain tests with statuses:
91+
92+
+--------+
93+
| passed |
94+
+========+
95+
| 0 |
96+
+--------+

0 commit comments

Comments
 (0)