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

Commit 9302e27

Browse files
authored
Merge pull request #1308 from bjones1/testing
Misc test cleanup
2 parents bea64c4 + 5d20ac4 commit 9302e27

File tree

4 files changed

+20
-5
lines changed

4 files changed

+20
-5
lines changed

pytest.ini

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# ****************************
2+
# |docname| - Configure pytest
3+
# ****************************
4+
[pytest]
5+
# See `Registering marks <https://docs.pytest.org/en/stable/how-to/mark.html>`_; this mark is defined in `selenium_module_fixture`.
6+
markers =
7+
exit_status_success: Determine if the runestone build exit code is checked by ``selenium_module_fixture``.

runestone/codelens/test/test_codelens.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,15 @@
44
def test_Next_Step(selenium_utils_get):
55
driver = selenium_utils_get.driver
66
assert "CodeLens" in driver.title
7-
for tdiv in ["test_codelens_1", "test_codelens_2", "test_codelens_3", "test_codelens_4", "test_codelens_5", "test_codelens_6"]:
7+
for tdiv in [
8+
"test_codelens_1",
9+
"test_codelens_2",
10+
"test_codelens_3",
11+
"test_codelens_4",
12+
"test_codelens_5",
13+
"test_codelens_6",
14+
]:
15+
print(tdiv)
816
selenium_utils_get.wait_until_ready(tdiv)
917
clDiv = driver.find_element_by_id(tdiv)
1018
assert clDiv

runestone/common/test/test_error/test_add_js_error.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77

88
def test_1(selenium_module_fixture):
9-
assert(
10-
"Extension error:\nUnable to find this_file_does_not_exist.js in html_static_path." in
11-
selenium_module_fixture.build_stderr_data,
9+
assert (
10+
"Extension error:\nUnable to find this_file_does_not_exist.js in html_static_path."
11+
in selenium_module_fixture.build_stderr_data
1212
)

runestone/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def run_webpack():
6868
# Provide access to the Selenium module fixture, for tests with specific needs.
6969
@pytest.fixture(scope="module")
7070
def selenium_module_fixture(request):
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>`_.
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>`_.
7272
exit_status_success_mark = request.node.get_closest_marker("exit_status_success")
7373
exit_status_success = True if exit_status_success_mark is None else exit_status_success_mark.args[0]
7474

0 commit comments

Comments
 (0)