We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tests/test_run_examples.py::test_ruff_error
ruff
Yesterday ruff 0.1.2 was released. With this new version, the following test fails:
=================================== FAILURES =================================== _______________________________ test_ruff_error ________________________________ pytester = <Pytester PosixPath('/build/pytest-of-nixbld/pytest-0/test_ruff_error0')> def test_ruff_error(pytester: pytest.Pytester): pytester.makefile( '.md', my_file='```py\nimport sys\nprint(missing)\n```', ) # language=Python pytester.makepyfile( """ from pytest_examples import find_examples, CodeExample, EvalExample import pytest @pytest.mark.parametrize('example', find_examples('.'), ids=str) def test_find_run_examples(example: CodeExample, eval_example: EvalExample): eval_example.lint_ruff(example) """ ) result = pytester.runpytest('-p', 'no:pretty', '-v') result.assert_outcomes(failed=1) output = '\n'.join(result.outlines) output = re.sub(r'(=|_){3,}', r'\1\1\1', output) > assert ( '=== FAILURES ===\n' '___ test_find_run_examples[my_file.md:1-4] ___\n' 'ruff failed:\n' ' my_file.md:2:8: F401 [*] `sys` imported but unused\n' ' my_file.md:3:7: F821 Undefined name `missing`\n' ' Found 2 errors.\n' ' [*] 1 potentially fixable with the --fix option.\n' '=== short test summary info ===\n' ) in output E AssertionError: assert '=== FAILURES ===\n___ test_find_run_examples[my_file.md:1-4] ___\nruff failed:\n my_file.md:2:8: F401 [*] `sys` impo...me `missing`\n Found 2 errors.\n [*] 1 potentially fixable with the --fix option.\n=== short test summ ary info ===\n' in '=== test session starts ===\nplatform linux -- Python 3.11.5, pytest-7.4.2, pluggy-1.2.0 -- /nix/store/ffll6glz3gwx34... info ===\nFAILED test_ruff_error.py::test_find_run_examples[my_file.md:1-4] - Failed: r...\n=== 1 failed in 0.02s = ==' /build/source/tests/test_run_examples.py:108: AssertionError ----------------------------- Captured stdout call ----------------------------- ============================= test session starts ============================== platform linux -- Python 3.11.5, pytest-7.4.2, pluggy-1.2.0 -- /nix/store/ffll6glz3gwx342z0ch8wx30p5cnqz1z-python3-3.11.5/bin/python3.11 cachedir: .pytest_cache rootdir: /build/pytest-of-nixbld/pytest-0/test_ruff_error0 plugins: examples-0.0.10 collecting ... collected 1 item test_ruff_error.py::test_find_run_examples[my_file.md:1-4] FAILED [100%] =================================== FAILURES =================================== ____________________ test_find_run_examples[my_file.md:1-4] ____________________ ruff failed: my_file.md:2:8: F401 [*] `sys` imported but unused my_file.md:3:7: F821 Undefined name `missing` Found 2 errors. [*] 1 fixable with the `--fix` option. =========================== short test summary info ============================ FAILED test_ruff_error.py::test_find_run_examples[my_file.md:1-4] - Failed: r... ============================== 1 failed in 0.02s =============================== =========================== short test summary info ============================ FAILED tests/test_run_examples.py::test_ruff_error - AssertionError: assert '=== FAILURES ===\n___ test_find_run_examples[my_fil... =================== 1 failed, 71 passed, 1 xfailed in 2.07s ====================
The text was updated successfully, but these errors were encountered:
Fixed on main now! Thanks for the report.
main
Sorry, something went wrong.
Thanks !
Successfully merging a pull request may close this issue.
Yesterday ruff 0.1.2 was released.
With this new version, the following test fails:
The text was updated successfully, but these errors were encountered: