Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

Testing.Update Test Outcomes

БесплатноБез исполняемых скриптовНе проверен

Update the expected outcome of failing unit tests

gpsaggeseот gpsaggese★ 158 звёзд на GitHub

Об этом скилле

Goal

  • The user passes a list of tests, or a repro script, with failing tests <FAILING_TESTS> whose actual and expected outputs mismatch

Plan Only (--only_plan)

  • With --only_plan, follow .claude/skills/skill.rules.md section "Create Only a Plan with --only_plan"
  • Write the plan to testing.update_test_outcomes.<INPUT_REF>.md, then stop without executing the skill
    • Run the skill through "Classify the Assertion Method", and stop before "Update the Expected Output"

Important

  • For all code, follow .claude/skills/coding.rules.md
  • Follow the invariants and conventions for unit tests in .claude/skills/testing.rules.md

Workflow

Run the Failing Tests

  • Run the tests one at a time, the way the user suggested, to confirm they fail due to mismatching outputs

Classify the Assertion Method

  • For each failing test method, check whether the result is checked with

    • self.check_string()
    • self.assert_equal() or a similar assertion (e.g., hunteuti.assert_sys_calls(), self.assertEqual())
  • Print a table with the following info: path of test | fail / pass | check_string or assert_equal

    | Path | Test | Status | Assertion Method |
    |------|------|--------|------------------|
    | dev_scripts_helpers/documentation/test/test_notes_to_pdf.py | Test_notes_to_pdf_latex_options::test1 | FAIL | self.assert_equal() with fuzzy_match=True |
    | dev_scripts_helpers/documentation/test/test_notes_to_pdf.py | Test_notes_to_pdf_latex_options::test2 | FAIL | self.assert_equal() with fuzzy_match=True |
    | dev_scripts_helpers/documentation/test/test_notes_to_pdf.py | Test_notes_to_pdf_output_types::test1 | FAIL | self.assert_equal() with fuzzy_match=True |
    
  • Save this to testing.update_test_outcomes.<INPUT_REF>.md in the current dir

    • <INPUT_REF> comes from <FAILING_TESTS>, as in .claude/skills/skill.rules.md ### Name the Output File

Update the Expected Output

  • For each failing test method:

    • If the result is checked with self.check_string()
      • Run the test with the pytest option --update_golden to refresh the output
    • If the result is checked with self.assert_equal() or a similar assertion (e.g., hunteuti.assert_sys_calls()), read the file <TEST_DIR>/tmp.initial.actual.txt (e.g., dev_scripts_helpers/documentation/test/outcomes/Test_run_pandoc_to_html.test1) that holds the actual variable, and update the expected variable
      • E.g.,
        expected = """
        [{'args': (f'jupytext --to ipynb --update {py_file}',),
          'function': 'hsystem.system',
          'kwargs': {}},
         {'args': (f'jupytext --sync {py_file}',),
          'function': 'hsystem.system',
          'kwargs': {}}]
        """
        
  • Follow .claude/skills/testing.rules.md:

    • ## Code Formatting in Tests
    • # Test Input and Output Handling
  • Do not change how results are checked

    • E.g., do not replace self.assert*() with self.check_string() or vice versa
    • E.g., do not replace self.assert*() with self.assertIn()

Verification

  • --only_plan (check only this item): the plan is in testing.update_test_outcomes.<INPUT_REF>.md in the current dir, has the Generated by line, and nothing was executed
  • The output file is testing.update_test_outcomes.<INPUT_REF>.md in the current dir
  • Run all the tests to make sure they are passing
Полный SKILL.md на GitHub

Установить Testing.Update Test Outcomes в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл Testing.Update Test Outcomes?

Update the expected outcome of failing unit tests

Как установить скилл Testing.Update Test Outcomes?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл Testing.Update Test Outcomes запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить Testing.Update Test Outcomes с