eranheres / ultra_type

0 stars 0 forks source link

sweep: fix the unit testing on test_language.py #23

Closed eranheres closed 9 months ago

eranheres commented 9 months ago

Fix the following testing:

TestLanguageLoadWords::test_load_words_unsupported_language - AssertionError: None != [] TestLanguageGetWord::test_get_word_when_words_is_empty - AttributeError: <class 'unittest.mock.MagicMock

Checklist - [X] Test `tests/test_language.py` ✓ https://github.com/eranheres/ultra_type/commit/dea2592733baa89182d65bcc00e58480d0162d91 - [X] Ran sandbox for `tests/test_language.py`. ✗ - [X] Modify `tests/test_language.py` ✓ https://github.com/eranheres/ultra_type/commit/28405a86f88cd6ac158c32dd2d5cba03ce9f1b67 - [X] Ran sandbox for `tests/test_language.py`. ✗ - [X] Modify `tests/test_language.py` ✓ https://github.com/eranheres/ultra_type/commit/06f9019825242bf5dc166f62d98fe67f24b555e7 - [X] Ran sandbox for `tests/test_language.py`. ✓ - [X] Ran sandbox for `tests/test_language.py`. ✓ - [X] Ran sandbox for `tests/test_language.py`. ✓ ![Flowchart](https://raw.githubusercontent.com/eranheres/ultra_type/sweep/assets/196bee2a5c357d1eb3d3b13111830805f9c7f09b9754ca5a9fb0c0288c2002aa_23_flowchart.svg)
sweep-mine[bot] commented 9 months ago

Here's the PR! https://github.com/eranheres/ultra_type/pull/24.

💎 Sweep Pro: I'm using GPT-4. You have unlimited GPT-4 tickets. (tracking ID: 1fcca28f8f)

Actions (click)

Sandbox Execution ✓

Here are the sandbox execution logs prior to making any changes:

Sandbox logs for 1957c01
poetry run pylint -E **/*.py 1/1 ✓
(nothing was outputted)

Sandbox passed on the latest main, so sandbox checks will be enabled for this issue.


Step 1: 🔎 Searching

I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.

Some code snippets I looked at (click to expand). If some file is missing from here, you can mention the path in the ticket description. https://github.com/eranheres/ultra_type/blob/1957c01e9672a1a7aeb80bdf94bb581b5db1af2c/tests/test_language.py#L1-L90 https://github.com/eranheres/ultra_type/blob/1957c01e9672a1a7aeb80bdf94bb581b5db1af2c/tests/test_model.py#L1-L142 https://github.com/eranheres/ultra_type/blob/1957c01e9672a1a7aeb80bdf94bb581b5db1af2c/ultra_type/language.py#L1-L15 https://github.com/eranheres/ultra_type/blob/1957c01e9672a1a7aeb80bdf94bb581b5db1af2c/pyproject.toml#L1-L15 https://github.com/eranheres/ultra_type/blob/1957c01e9672a1a7aeb80bdf94bb581b5db1af2c/README.md#L1-L20

Step 2: ⌨️ Coding

Test coverage generation failed with error:

/root/.cache/pypoetry/virtualenvs/ultra-type-gW_DSdP6-py3.10/lib/python3.10/site-packages/coverage/control.py:883: CoverageWarning: No data was collected. (no-data-collected)
  self._warn("No data was collected.", slug="no-data-collected")

poetry run pylint -E **/*.py 1/1 ❌ (`2`)
************* Module tests.test_language
tests/test_language.py:41:42: E0001: Parsing failed: 'unindent does not match any outer indentation level (, line 41)' (syntax-error)

poetry run pylint -E **/*.py 1/1 ❌ (`2`)
************* Module tests.test_language
tests/test_language.py:90:19: E1120: No value for argument 'language' in constructor call (no-value-for-parameter)
tests/test_language.py:102:19: E1120: No value for argument 'language' in constructor call (no-value-for-parameter)
tests/test_language.py:135:19: E1120: No value for argument 'language' in constructor call (no-value-for-parameter)

poetry run pylint -E **/*.py 1/1 ✓
(nothing was outputted)

poetry run pylint -E **/*.py 1/1 ✓
(nothing was outputted)

poetry run pylint -E **/*.py 1/1 ✓
(nothing was outputted)


Step 3: 🔁 Code Review

I have finished reviewing the code for completeness. I did not find errors for sweep/fix-unit-tests-language-class.


🎉 Latest improvements to Sweep:


💡 To recreate the pull request edit the issue title or description. To tweak the pull request, leave a comment on the pull request. Join Our Discord