From aa98aa8b40c8caa5e49d23ddcb895d7dbe6bec51 Mon Sep 17 00:00:00 2001 From: yattom Date: Tue, 7 Jul 2020 07:59:45 +0900 Subject: [PATCH 01/11] update requirements.txt to latest versions --- requirements.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/requirements.txt b/requirements.txt index ab0619b..b213abb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,9 +1,9 @@ cov-core==1.15.0 -coverage==4.4.1 -execnet==1.4.1 -py==1.4.34 -pytest==3.1.3 -pytest-cov==2.5.1 -pytest-xdist==1.18.0 +coverage==5.2 +execnet==1.7.1 +py==1.9.0 +pytest==5.4.3 +pytest-cov==2.10.0 +pytest-xdist==1.32.0 tox==2.7.0 -virtualenv==15.1.0 +virtualenv==20.0.25 From 94ccd92b2d9e41f487f2e493efc37c807e048d98 Mon Sep 17 00:00:00 2001 From: yattom Date: Tue, 7 Jul 2020 08:34:22 +0900 Subject: [PATCH 02/11] update README to latest versions --- README.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index e5ae659..dc41711 100644 --- a/README.rst +++ b/README.rst @@ -9,10 +9,10 @@ TDDBC for Python with Pytest 動作確認環境 ============ -- Python 2.7.6 -- Python 3.3.1 -- PyPy 1.9.0 -- PyPy 2.2.0 +- Python 3.8.0 +- pytest 5.4.3 + +※Python2は2020年1月にサポート終了(EOL)していますので、Python3をご利用ください。 セットアップ ============ From ddc44e06f8a2e4605427360c3666b801e31616dd Mon Sep 17 00:00:00 2001 From: yattom Date: Mon, 10 May 2021 15:53:27 +0900 Subject: [PATCH 03/11] fix python versions --- .travis.yml | 7 +++---- tox.ini | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index e798535..6c1bf0e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,8 @@ language: python python: - - 2.7 - - 3.3 - - 3.4 - - 3.5 + - 3.6 + - 3.7 + - 3.8 - pypy install: diff --git a/tox.ini b/tox.ini index 2d3a29c..b2a5d91 100644 --- a/tox.ini +++ b/tox.ini @@ -1,10 +1,9 @@ [tox] skipsdist = True envlist = - py27, - py33, - py34, - py35 + py36, + py37, + py38 [testenv] deps= From ab8bd842c3dd1ef7f1d3b67ef641d0220c0e5690 Mon Sep 17 00:00:00 2001 From: yattom Date: Mon, 10 May 2021 16:15:36 +0900 Subject: [PATCH 04/11] use latest modules --- requirements.txt | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/requirements.txt b/requirements.txt index b213abb..04dac95 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,9 +1,13 @@ +appdirs==1.4.4 cov-core==1.15.0 -coverage==5.2 -execnet==1.7.1 -py==1.9.0 -pytest==5.4.3 -pytest-cov==2.10.0 -pytest-xdist==1.32.0 -tox==2.7.0 -virtualenv==20.0.25 +coverage==5.5 +distlib==0.3.1 +execnet==1.8.0 +filelock==3.0.12 +iniconfig==1.1.1 +py==1.10.0 +pytest-cov==2.11.1 +pytest-xdist==2.2.1 +pytest==6.2.4 +tox==3.23.1 +virtualenv==20.4.6 From 652d920119335d92228263b2db2dd1c098823a37 Mon Sep 17 00:00:00 2001 From: yattom Date: Mon, 10 May 2021 16:18:08 +0900 Subject: [PATCH 05/11] support Python3.9 --- .travis.yml | 3 ++- tox.ini | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6c1bf0e..936f566 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,8 @@ python: - 3.6 - 3.7 - 3.8 - - pypy + - 3.9 + - pypy3 install: - pip install tox tox-travis diff --git a/tox.ini b/tox.ini index b2a5d91..864ad4d 100644 --- a/tox.ini +++ b/tox.ini @@ -3,7 +3,8 @@ skipsdist = True envlist = py36, py37, - py38 + py38, + py39 [testenv] deps= From 55b09cdae93aab339b169d71cb670cf95d64fbe9 Mon Sep 17 00:00:00 2001 From: yattom Date: Mon, 10 May 2021 16:26:51 +0900 Subject: [PATCH 06/11] update README --- README.rst | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/README.rst b/README.rst index dc41711..6cefb68 100644 --- a/README.rst +++ b/README.rst @@ -9,7 +9,7 @@ TDDBC for Python with Pytest 動作確認環境 ============ -- Python 3.8.0 +- Python 3.8.5 - pytest 5.4.3 ※Python2は2020年1月にサポート終了(EOL)していますので、Python3をご利用ください。 @@ -19,27 +19,28 @@ TDDBC for Python with Pytest .. code-block:: sh - $ pip install -r requirements.txt + $ pip3 install -r requirements.txt **setup.py** を実行し .. code-block:: sh - $ python setup.py test + $ python3 setup.py test ... # Output sample - ======================== test session starts ================================= - platform linux2 -- Python 2.7.3[pypy-2.2.0-final] -- pytest-2.4.2 - -- ~/.virtualenvs/tddbc_python_pytest_pypy22/bin/python - plugins: cov, xdist + ============================= test session starts ============================== + platform linux -- Python 3.8.5, pytest-6.2.4, py-1.10.0, pluggy-0.13.1 -- /usr/bin/python3 + cachedir: .pytest_cache + rootdir: /root/work/python_pytest, configfile: setup.cfg + plugins: forked-1.3.0, cov-2.11.1, xdist-2.2.1 collected 3 items - tests/acme/test_acme.py:28: TestPython.test_be_out_of_question PASSED - tests/acme/test_acme.py:41: TestMontyPython.test_say_name[Monty Python] PASSED - tests/acme/test_acme.py:41: TestMontyPython.test_say_name[John Smith] PASSED - ======================== 3 passed in 0.10 seconds ============================ + tests/acme/test_snake.py::TestPython::test_be_out_of_question PASSED [ 33%] + tests/acme/test_snake.py::TestMontyPython::test_say_name[Monty Python] PASSED [ 66%] + tests/acme/test_snake.py::TestMontyPython::test_say_name[John Smith] PASSED [100%] + ============================== 3 passed in 0.05s =============================== のように正常終了すればOKです From c1d5feb4ff058507fa03d55a4191664e61668a91 Mon Sep 17 00:00:00 2001 From: yattom Date: Mon, 10 May 2021 16:56:19 +0900 Subject: [PATCH 07/11] correct pytest version in README --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 6cefb68..a9be70f 100644 --- a/README.rst +++ b/README.rst @@ -10,7 +10,7 @@ TDDBC for Python with Pytest ============ - Python 3.8.5 -- pytest 5.4.3 +- pytest 6.2.4 ※Python2は2020年1月にサポート終了(EOL)していますので、Python3をご利用ください。 From 3856cd862cc32b122f4724a40bd927a1db6eae21 Mon Sep 17 00:00:00 2001 From: yattom Date: Mon, 10 May 2021 17:02:15 +0900 Subject: [PATCH 08/11] to make command 'pytest' usable --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index 04dac95..8f8cbf6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ +-e . appdirs==1.4.4 cov-core==1.15.0 coverage==5.5 From b954c59a7530ae22739e086ee6e2f3dbbb07bca7 Mon Sep 17 00:00:00 2001 From: yattom Date: Mon, 10 May 2021 17:18:38 +0900 Subject: [PATCH 09/11] running 'python setup.py test' is deprecated --- setup.py | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/setup.py b/setup.py index 4687786..d13886d 100644 --- a/setup.py +++ b/setup.py @@ -1,19 +1,4 @@ from setuptools import setup, find_packages -from setuptools.command.test import test as TestCommand -import sys - - -class PyTest(TestCommand): - def finalize_options(self): - TestCommand.finalize_options(self) - self.test_args = [] - self.test_suite = True - - def run_tests(self): - #import here, cause outside the eggs aren't loaded - import pytest - errno = pytest.main(self.test_args) - sys.exit(errno) setup( name='skeleton_for_pytest', @@ -25,7 +10,6 @@ def run_tests(self): license='MIT', packages=find_packages(exclude=['tests']), tests_require=['pytest'], - cmdclass={'test': PyTest}, classifiers=[ 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', From 9c797d01b591a0b967f8d62b60809a5ce330381e Mon Sep 17 00:00:00 2001 From: yattom Date: Mon, 10 May 2021 17:29:24 +0900 Subject: [PATCH 10/11] tox use 'pytest' to run tests --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 864ad4d..117cff9 100644 --- a/tox.ini +++ b/tox.ini @@ -10,4 +10,4 @@ envlist = deps= -r{toxinidir}/requirements.txt commands= - python setup.py test + pytest From f21afd5cd3e002bf640a5fd04c1429259543c06c Mon Sep 17 00:00:00 2001 From: yattom Date: Mon, 10 May 2021 17:43:10 +0900 Subject: [PATCH 11/11] update README to use pytest command --- README.rst | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index a9be70f..110816f 100644 --- a/README.rst +++ b/README.rst @@ -17,15 +17,19 @@ TDDBC for Python with Pytest セットアップ ============ +以下のように実行して、環境を構築してください。 + .. code-block:: sh + $ git clone https://github.com/yattom/python_pytest.git + $ cd python_pytest $ pip3 install -r requirements.txt -**setup.py** を実行し +テストを実行するには **pytest** コマンドを使います。 .. code-block:: sh - $ python3 setup.py test + $ pytest ... @@ -40,7 +44,8 @@ TDDBC for Python with Pytest tests/acme/test_snake.py::TestPython::test_be_out_of_question PASSED [ 33%] tests/acme/test_snake.py::TestMontyPython::test_say_name[Monty Python] PASSED [ 66%] tests/acme/test_snake.py::TestMontyPython::test_say_name[John Smith] PASSED [100%] - ============================== 3 passed in 0.05s =============================== + + ============================== 3 passed in 0.04s =============================== のように正常終了すればOKです