RunestoneInteractive / RunestoneInteractive/rs

Runestone Issue: Python unittest feedback table column headers Expected & Actual in wrong order

Open
#1,332 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
69
Forks
117
Avg merge
6d 4h
Merged PRs (30d)
24

Description

In Python unit tests, the column headers of Actual and Expected are in the wrong order. It doesn't matter if you use assertEqual, but if you use assertIn or assertNotEqual then the first argument is what is expected. Kate (@kmcdonnell2) and I confirmed that they are in the right order in Java books, but not in Python books.
Python feedback for

  self.assertIn("%", self.getEditorText().replace(" ", ""), "Use % with newTime and 12.")
  self.assertEqual(clockTime, 4, "Testing that clockTime has the correct value." )
  self.assertNotIn("4",self.getEditorText(),"Testing that you didn't hardcode the answer. Make sure to calculate it!")

generates the following where the first column should be Expected Value, not Actual, which makes a difference for the 1st and 3rd rows.
Image

Compared to Java books where Expected and Actual are in the correct order:

Image

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test path is named. Start by locating the Python unittest feedback-table generation using the reported assertIn, assertEqual, and assertNotIn examples, then compare its column order with the Java feedback shown in the issue; done means Expected Value appears before Actual Value and the affected rows display the correct values.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.