-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
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
テスト実行をpytestに移行 #17
テスト実行をpytestに移行 #17
Conversation
438e693
to
d95a46c
Compare
b3f0124
to
ada523c
Compare
ada523c
to
41718f8
Compare
@@ -33,8 +29,7 @@ | |||
], | |||
}, | |||
] | |||
|
|||
CELERY_TASK_ALWAYS_EAGER = True | |||
USE_TZ = False # For Django 5.0+ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MEMO: Django5.0で値が変更されるので明示的に設定
RemovedInDjango50Warning: The default value of USE_TZ will change from False to True in Django 5.0. Set USE_TZ to False in your project settings if you want to keep the current default behavior.
warnings.warn(
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
@@ -1,7 +0,0 @@ | |||
# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
以下のように非推奨であるメッセージがでるので [beproud/django/__init__.py](https://github.com/beproud/bpnotify/pull/17/files#diff-b84fb5fc7ef473b9cb42b0a428ef8da21bc7978986580b82b657b8cbb288498d)
と合わせて削除
.tox/py311-dj42-celery53/lib/python3.11/site-packages/pkg_resources/__init__.py:121
/Users/kashew/projects/github.com/beproud/bpnotify/.tox/py311-dj42-celery53/lib/python3.11/site-packages/pkg_resources/__init__.py:121: DeprecationWarning: pkg_resources is deprecated as an API
warnings.warn("pkg_resources is deprecated as an API", DeprecationWarning)
beproud/__init__.py:3
/Users/kashew/projects/github.com/beproud/bpnotify/beproud/__init__.py:3: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('beproud')`.
Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
__import__('pkg_resources').declare_namespace(__name__)
beproud/django/__init__.py:3
/Users/kashew/projects/github.com/beproud/bpnotify/beproud/django/__init__.py:3: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('beproud.django')`.
Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
__import__('pkg_resources').declare_namespace(__name__)
.tox/py311-dj42-celery53/lib/python3.11/site-packages/pkg_resources/__init__.py:2349
/Users/kashew/projects/github.com/beproud/bpnotify/.tox/py311-dj42-celery53/lib/python3.11/site-packages/pkg_resources/__init__.py:2349: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('beproud')`.
Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
declare_namespace(parent)
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
知らない人のために一応参考記事を貼っておきますね
Python 3.3b1 の名前空間パッケージを試してみた — 清水川Web
@@ -1,3 +0,0 @@ | |||
from setuptools import setup | |||
|
|||
setup(test_suite="tests.main") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
python setup.py test
コマンドのために残していただけなので削除
# For Celery Tests | ||
app = celery.Celery() | ||
app.config_from_object('django.conf:settings', namespace='CELERY') | ||
app.autodiscover_tasks(lambda: INSTALLED_APPS) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ここだけ追加している。他はimport順&記述内容の整理
@@ -1,46 +0,0 @@ | |||
import os |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pytest化したので削除
* Celery (5.3) | ||
* Django (4.2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
もう使わなくなったのは削除した。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!!
@@ -15,7 +15,7 @@ jobs: | |||
strategy: | |||
matrix: | |||
python-version: ['3.9', '3.10', '3.11', '3.12'] | |||
django-version: ['3.2', '4.2'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
|
||
* Drop Django3.2&Celery5.2 | ||
* Migrate from ``python setup.py test`` to ``pytest`` | ||
|
||
0.49 (2024-02-XX) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
おっと日付がXXのままだw
@@ -1,7 +0,0 @@ | |||
# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
知らない人のために一応参考記事を貼っておきますね
Python 3.3b1 の名前空間パッケージを試してみた — 清水川Web
"Framework :: Django :: 4.2", | ||
"Intended Audience :: Developers", | ||
"Environment :: Plugins", | ||
"Topic :: Software Development :: Libraries :: Python Modules", | ||
] | ||
dependencies = ["Django>=3.2", "six", "Celery"] | ||
dependencies = ["Django>=4.2", "six", "Celery"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(six.. まだいたのか)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
目的
具体的な変更内容
python -m build && twine check時のログ