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

Commit 9694e1c

Browse files
authored
Merge pull request #1339 from bjones1/test-fix
Test fix
2 parents f1f316e + 1c57efb commit 9694e1c

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

.github/workflows/python-package.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,21 @@ jobs:
2727
channel: "#builds"
2828
if: always()
2929

30-
- name: Setup npm and build runestone.js
30+
- name: Install npm dependencies
3131
run: |
3232
npm install
3333
- name: Set up Python ${{ matrix.python-version }}
3434
uses: actions/setup-python@v2
3535
with:
3636
python-version: ${{ matrix.python-version }}
37-
- name: Install dependencies
37+
- name: Install Python dependencies
3838
run: |
39-
python -m pip install --upgrade pip
40-
# Install Poetry per the `instructions <https://python-poetry.org/docs/#osx--linux--bashonwindows-install-instructions>`.
41-
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
42-
$HOME/.poetry/bin/poetry install
39+
# Install Poetry per the `instructions <https://python-poetry.org/docs/master/#installing-with-the-official-installer>`.
40+
curl -sSL https://install.python-poetry.org | python3 -
41+
$HOME/.local/bin/poetry install
4342
- name: Tests
4443
run: |
45-
$HOME/.poetry/bin/poetry run pytest
44+
$HOME/.local/bin/poetry run pytest
4645
4746
- uses: act10ns/slack@v1
4847
with:

runestone/conftest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def setUpModule(self):
122122
os.chdir(self.base_path)
123123
# Compile the docs. Save the stdout and stderr for examination.
124124
p = subprocess.run(
125-
["runestone", "build", "--all"], capture_output=True, text=True,
125+
[sys.executable, "-m", "runestone", "build", "--all"], capture_output=True, text=True,
126126
)
127127
self.build_stdout_data = p.stdout
128128
self.build_stderr_data = p.stderr
@@ -184,9 +184,9 @@ def setUpModule(self):
184184
"Unknown error while trying to kill stale runestone server"
185185
)
186186

187-
# Run the server. Simply calling ``runestone serve`` fails, since the process killed isn't the actual server, but probably a setuptools-created launcher.
187+
# Run the server. Simply calling ``runestone preview`` fails, since the process killed isn't the actual server, but probably a setuptools-created launcher.
188188
self.runestone_server = subprocess.Popen(
189-
[sys.executable, "-m", "runestone", "serve", "--port", PORT]
189+
[sys.executable, "-m", "runestone", "preview", "--port", PORT]
190190
)
191191

192192
# Testing time in dominated by browser startup/shutdown. So, simply run all tests in a module in a single browser instance to speed things up. See ``RunestoneTestCase.setUp`` for additional code to (mostly) clear the browser between tests.

runestone/hparsons/test/test_hparsons.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def test_run_block(selenium_utils_get):
5151
# 1-2. Click on run button to check the result is hinting missing blocks
5252
run_btn.click()
5353
feedback_area = hp_question.find_element(By.CLASS_NAME, 'alert')
54-
assert 'Your program is too short.' in feedback_area.text
54+
assert 'Your answer is too short.' in feedback_area.text
5555

5656
# 2-1. Click on more blocks to form an incorrect solution
5757
block = drag_area.find_element(By.CSS_SELECTOR, '.parsons-block')
@@ -60,7 +60,7 @@ def test_run_block(selenium_utils_get):
6060
run_btn.click()
6161
time.sleep(1)
6262
feedback_area = hp_question.find_element(By.CLASS_NAME, 'alert')
63-
assert 'Highlighted blocks in your program are wrong or are in the wrong order.' in feedback_area.text
63+
assert 'Highlighted blocks in your answer are wrong or are in the wrong order.' in feedback_area.text
6464
highlighted_blocks = []
6565
for block in drop_area.find_elements(By.CSS_SELECTOR, '.parsons-block.incorrectPosition'):
6666
highlighted_blocks.append(block.text)

0 commit comments

Comments
 (0)