To set up automated Ruff linting and formatting with VS Code, Follow the instructions:
The Python extension for VS Code is needed to enable Python-specific features, such as linting and formatting integration. Open VS Code, go to the Extensions view (Ctrl+Shift+X or Cmd+Shift+X on macOS),search for "Python" by Microsoft and install it if you haven’t already.
Install the Ruff extension in VS Code to enable real-time linting and formatting. In the Extensions view, search for "Ruff," and install the extension.
poetry run ruff format .poetry run ruff check .For testing, we use pytest.
poetry add --dev pytestThis command will run files named test_*.py or *_test.py
poetry run pytestFor more detailed test result, you can use -v option
poetry run pytest -vfor more detailed test information
poetry run pytest -vvYou should name your test class and method as follows:
class TestMyFeature: # class name
def test_feature_functionality: # method name