ノンプログラマーなエンジニアを対象としたプログラミング言語 Python のトレーニング。演習込みで 4時間 x 4日間 の内容を1スライドにまとめています。 プログラミングとはなんぞや、なぜpythonをやるのかというところから、クラスの継承あたりまでをカバーしています。それにくわえて業務によく利用されると思われる機能を説明しています。

PyPI に testing.mysqld と testing.cassandra をリリースしました。 パッケージ名に test と付いている通り、テストに使うモジュールです。 11/21訂正: test というパッケージは python 本体で使われていたので、パッケージ名を testing.* に変更しました。 なにをするもの? test.mysqld と test.cassandra はテストを実行する際に MySQL (Cassandra) を起動し、 テストが終了したあとに MySQL (Cassandra) を終了するという動きをしてくれるライブラリです。 Perl の Test::mysqld を Python で実装しなおしたものです。 テストする際にホンモノの MySQL や Cassandra が必要な場合に使えるかもしれません。 なんのためにつくったの? これまで
PerlでいうところのTest::TCP相当のことをPythonでやるライブラリをPyPIに上げました。ようやくPyPIデビューです。 https://github.com/nekoya/python-tcptest https://pypi.python.org/pypi/tcptest Test::TCPはPerlでテスト時に一時的にサーバを起動したりする処理の基盤となるライブラリです。同等のことをPythonでやるのに適当なものが見当たらなかったので自分で書いたという経緯です。 社内では以前からこの仕組みを使ってテストを書いていたのですが、自社のconfig系のライブラリとの結合を排除して、再構成したものになります。今回こうして公開するにあたって、関数名をオリジナルのPerl版に近付けたり、TestServerの実装を全面的に見直したりしました。 tcptestパッケージにはTest
Unverified details These details have not been verified by PyPI Project links Homepage Meta License: MIT License (MIT) Author: holger krekel Classifiers Development Status 4 - Beta Framework tox Intended Audience Developers License OSI Approved :: MIT License Operating System MacOS :: MacOS X Microsoft :: Windows POSIX Programming Language Python Python :: 2.7 Python :: 3.4 Python :: 3.5 Python ::
RSpec の入門とその一歩先へ がとてもよい記事だったので、 Python で写経させてもらいました。 https://github.com/methane/pytest-tut Ruby コミュニティと Python コミュニティの考え方の違いも見えて面白いと思います。 環境は Python 3.3 で、実行には py.test コマンドを使いましたが、 py.test の機能は特に使っていないので nose でもなんでも大丈夫です。 ファイルの作成 まずは空の実装とテストを作ります。 message_filter.py class MessageFilter: pass message_filter_test.py 最初のテストを書く py.test は .should といったメソッドを勝手に生やしたりはしません。普通に assert 文を書きましょう。 --- a/messege
$ pip install nose $ pip install mock $ pip install coverage $ pip install tox
tox aims to automate and standardize testing in Python. It is part of a larger vision of easing the packaging, testing and release process of Python software (alongside pytest and devpi). tox is a generic virtual environment management and test command line tool you can use for: checking your package builds and installs correctly under different environments (such as different Python implementatio
pytest: helps you write better programs¶ The pytest framework makes it easy to write small, readable tests, and can scale to support complex functional testing for applications and libraries. pytest requires: Python 3.7+ or PyPy3. PyPI package name: pytest A quick example¶ # content of test_sample.py def inc(x): return x + 1 def test_answer(): assert inc(3) == 5 $ pytest ==========================
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く