Taragolis commented on code in PR #37772:
URL: https://github.com/apache/airflow/pull/37772#discussion_r1505953212
##########
pyproject.toml:
##########
@@ -1497,10 +1505,16 @@ banned-module-level-imports = ["numpy", "pandas"]
"flask.escape".msg = "Use markupsafe.escape instead. Deprecated in Flask 2.3,
removed in Flask 3.0"
"flask.Markup".msg = "Use markupsafe.Markup instead. Deprecated in Flask 2.3,
removed in Flask 3.0"
"flask.signals_available".msg = "Signals are always available. Deprecated in
Flask 2.3, removed in Flask 3.0"
+# Some specific cases
+"unittest.TestCase".msg = "Use pytest compatible classes"
[tool.ruff.lint.flake8-type-checking]
exempt-modules = ["typing", "typing_extensions"]
+[tool.ruff.lint.flake8-pytest-style]
+mark-parentheses = false
+fixture-parentheses = false
Review Comment:
`mark-parentheses`: if True (default for ruff) then `@pytest.mark.db_test()`
is valid option for non parametrised mark otherwise `@pytest.mark.db_test`
`fixture-parentheses`: if True (default for ruff) then use
`@pytest.fixture()` is valid option for non parametrised fixture otherwise
`@pytest.fixture`
Particular this option generate less changes, so assumption here that it is
correct selection for this rules
| | **mark-parentheses = `false`** |
**mark-parentheses = `true`** |
|---------------------------------|--------------------------------|-------------------------------|
| **fixture-parentheses = `false`** | 179 errors in 74 files | 990
errors in 267 files |
| **fixture-parentheses = `true`** | 271 errors in 150 files | 1082
errors in 311 files |
##########
tests/cli/commands/test_dag_command.py:
##########
@@ -598,12 +598,12 @@ def test_cli_list_import_errors(self):
dag_path = os.path.join(TEST_DAGS_FOLDER, "test_invalid_cron.py")
args = self.parser.parse_args(["dags", "list", "--output", "yaml",
"--subdir", dag_path])
with contextlib.redirect_stdout(StringIO()) as temp_stdout:
- with TestCase.assertRaises(TestCase(), SystemExit) as context:
+ with pytest.raises(SystemExit) as err_ctx:
Review Comment:
I've baned import `unittest.TestCase`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]