File tree Expand file tree Collapse file tree 4 files changed +10
-20
lines changed
Expand file tree Collapse file tree 4 files changed +10
-20
lines changed Original file line number Diff line number Diff line change @@ -17,15 +17,19 @@ TDDBC for Python with Pytest
1717セットアップ
1818============
1919
20+ 以下のように実行して、環境を構築してください。
21+
2022.. code-block :: sh
2123
24+ $ git clone https://github.com/yattom/python_pytest.git
25+ $ cd python_pytest
2226 $ pip3 install -r requirements.txt
2327
24- ** setup.py ** を実行し
28+ テストを実行するには ** pytest ** コマンドを使います。
2529
2630.. code-block :: sh
2731
28- $ python3 setup.py test
32+ $ pytest
2933
3034 ...
3135
@@ -40,7 +44,8 @@ TDDBC for Python with Pytest
4044 tests/acme/test_snake.py::TestPython::test_be_out_of_question PASSED [ 33%]
4145 tests/acme/test_snake.py::TestMontyPython::test_say_name[Monty Python] PASSED [ 66%]
4246 tests/acme/test_snake.py::TestMontyPython::test_say_name[John Smith] PASSED [100%]
43- ============================== 3 passed in 0.05s ===============================
47+
48+ ============================== 3 passed in 0.04s ===============================
4449
4550 のように正常終了すればOKです
4651
Original file line number Diff line number Diff line change 1+ -e .
12appdirs == 1.4.4
23cov-core == 1.15.0
34coverage == 5.5
Original file line number Diff line number Diff line change 11from setuptools import setup , find_packages
2- from setuptools .command .test import test as TestCommand
3- import sys
4-
5-
6- class PyTest (TestCommand ):
7- def finalize_options (self ):
8- TestCommand .finalize_options (self )
9- self .test_args = []
10- self .test_suite = True
11-
12- def run_tests (self ):
13- #import here, cause outside the eggs aren't loaded
14- import pytest
15- errno = pytest .main (self .test_args )
16- sys .exit (errno )
172
183setup (
194 name = 'skeleton_for_pytest' ,
@@ -25,7 +10,6 @@ def run_tests(self):
2510 license = 'MIT' ,
2611 packages = find_packages (exclude = ['tests' ]),
2712 tests_require = ['pytest' ],
28- cmdclass = {'test' : PyTest },
2913 classifiers = [
3014 'Intended Audience :: Developers' ,
3115 'License :: OSI Approved :: MIT License' ,
Original file line number Diff line number Diff line change @@ -10,4 +10,4 @@ envlist =
1010deps =
1111 -r{toxinidir}/requirements.txt
1212commands =
13- python setup.py test
13+ pytest
You can’t perform that action at this time.
0 commit comments