Skip to content

Commit

Permalink
Change test to use independent root
Browse files Browse the repository at this point in the history
  • Loading branch information
foster999 committed Aug 20, 2021
1 parent 88b5dfb commit 86d7a1a
Show file tree
Hide file tree
Showing 5 changed files with 144 additions and 1 deletion.
5 changes: 5 additions & 0 deletions tests/roots/test-conditionalassets-policy/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
project = "sphinx-tabs test"
master_doc = "index"
source_suffix = ".rst"
extensions = ["sphinx_tabs.tabs"]
pygments_style = "sphinx"
130 changes: 130 additions & 0 deletions tests/roots/test-conditionalassets-policy/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
.. toctree::

no_tabs1
no_tabs2

Fruits
========================================

.. tabs::

.. tab:: Apples

Apples are green, or sometimes red.

.. tab:: Pears

Pears are green.

.. tab:: Oranges

Oranges are orange.

Luminaries
========================================

.. tabs::

.. tab:: Sun

The sun is a star.

.. tab:: Moon

The moon is not a star.

Code Tabs
========================================

.. tabs::

.. code-tab:: c

C Main Function

.. code-tab:: c++

C++ Main Function

.. code-tab:: py

Python Main Function

.. code-tab:: java

Java Main Function

.. code-tab:: julia

Julia Main Function

.. code-tab:: fortran

Fortran Main Function

.. tabs::

.. code-tab:: c

int main(const int argc, const char **argv) {
return 0;
}
.. code-tab:: c++

int main(const int argc, const char **argv) {
return 0;
}
.. code-tab:: py

def main():
return

.. code-tab:: java

class Main {
public static void main(String[] args) {
}
}

.. code-tab:: julia

function main()
end

.. code-tab:: fortran

PROGRAM main
END PROGRAM main

Group Tabs
========================================

.. tabs::

.. group-tab:: Linux

Linux Line 1

.. group-tab:: Mac OSX

Mac OSX Line 1

.. group-tab:: Windows

Windows Line 1

.. tabs::

.. group-tab:: Linux

Linux Line 2

.. group-tab:: Mac OSX

Mac OSX Line 2

.. group-tab:: Windows

Windows Line 2
4 changes: 4 additions & 0 deletions tests/roots/test-conditionalassets-policy/no_tabs1.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Another page without tabs
========================================

No tabs to see here
4 changes: 4 additions & 0 deletions tests/roots/test-conditionalassets-policy/no_tabs2.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
And another page without tabs
========================================

No tabs to see here either
2 changes: 1 addition & 1 deletion tests/test_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def test_conditional_assets(app, docname, check_asset_links):

@pytest.mark.noautobuild
@pytest.mark.parametrize("docname", ["index", "no_tabs1", "no_tabs2"])
@pytest.mark.sphinx(testroot="conditionalassets")
@pytest.mark.sphinx(testroot="conditionalassets-policy")
@pytest.mark.skipif(
sphinx.version_info[:2] < (4, 1), reason="Test uses Sphinx 4.1 config"
)
Expand Down

0 comments on commit 86d7a1a

Please sign in to comment.