Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.

Commit 13a6c11

Browse files
authored
Merge pull request #1268 from bjones1/fix_tests
Fix: correct failing test.
2 parents 4a77ab2 + 6065f07 commit 13a6c11

2 files changed

Lines changed: 13 additions & 4 deletions

File tree

runestone/common/test/test_error/test_add_js_error.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
import pytest
2+
3+
4+
# This test causes Sphinx to produce an error, so don't abort the test when this happens. See `selenium_module_fixture`.
5+
pytestmark = pytest.mark.exit_status_success(False)
6+
7+
18
def test_1(selenium_module_fixture):
29
assert(
310
"Extension error:\nUnable to find this_file_does_not_exist.js in html_static_path." in

runestone/conftest.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
# ***************************************
44
# This defines fixtures specific to the client for test. These same fixtures are defined differently on the server to accommodate the different setup these.
55
#
6-
# TODO: rewrite the tests to use pytest-native syntax, then put the contents of ``unittest_base`` here.
76
#
87
# Imports
98
# =======
@@ -62,11 +61,14 @@ def run_webpack():
6261
print(p.stderr + p.stdout)
6362
assert not p.returncode
6463

65-
66-
# Provide access to the module fixture, for tests with specific needs.
64+
# .. _selenium_module_fixture:
65+
#
66+
# ``selenium_module_fixture``
67+
# ---------------------------
68+
# Provide access to the Selenium module fixture, for tests with specific needs.
6769
@pytest.fixture(scope="module")
6870
def selenium_module_fixture(request):
69-
# Allow tests to specify the ``exit_status_success`` parameter passed to the ModuleFixture constructor by adding the ``@pytest.mark.exit_status_success(False)`` decorator to a test. (Marking it True instead is equivalent to the unmarked, default value.) See the `example <https://docs.pytest.org/en/stable/fixture.html#using-markers-to-pass-data-to-fixtures>`_ and the API docs <https://docs.pytest.org/en/stable/reference.html#pytest.nodes.Node.get_closest_marker>`_.
71+
# Allow modules to specify the ``exit_status_success`` parameter passed to the ``ModuleFixture``` constructor by adding the statement ``pytestmark = pytest.mark.exit_status_success(False)``. (Since this is a module-scoped fixture, applying this mark to an individual test has no effect. Marking it True instead is equivalent to the unmarked, default value.) See the `example <https://docs.pytest.org/en/stable/fixture.html#using-markers-to-pass-data-to-fixtures>`_ (which applies only to function-scoped marks, not module-scoped marks), `marking whole classes or modules <https://docs.pytest.org/en/6.2.x/example/markers.html#marking-whole-classes-or-modules>`_, and the `API docs <https://docs.pytest.org/en/stable/reference.html#pytest.nodes.Node.get_closest_marker>`_.
7072
exit_status_success_mark = request.node.get_closest_marker("exit_status_success")
7173
exit_status_success = True if exit_status_success_mark is None else exit_status_success_mark.args[0]
7274

0 commit comments

Comments
 (0)