unittest — Unit testing framework¶ Source code: Lib/unittest/__init__.py (If you are already familiar with the basic concepts of testing, you might want to skip to the list of assert methods.) The unittest unit testing framework was originally inspired by JUnit and has a similar flavor as major unit testing frameworks in other languages. It supports test automation, sharing of setup and shutdown c
Source code: Lib/unittest/mock.py unittest.mock is a library for testing in Python. It allows you to replace parts of your system under test with mock objects and make assertions about how they have been used. unittest.mock provides a core Mock class removing the need to create a host of stubs throughout your test suite. After performing an action, you can make assertions about which methods / att
at·test /əˈtɛst/ To affirm to be correct, true, or genuine. Attest is a test automation framework for Python emphasising modern idioms and conventions. from attest import Tests math = Tests() @math.test def arithmetics(): """Ensure that the laws of physics are in check.""" assert 1 + 1 == 2 if __name__ == '__main__': math.run() Features¶ Collect tests using decorators instead of matching names aga
Unverified details These details have not been verified by PyPI Project links Homepage Changelog Documentation Issues Source Meta License: Apache Software License (Apache-2.0) Author: Mickaël Schoentgen Tags python , filesystem , monitoring , monitor , FSEvents , kqueue , inotify , ReadDirectoryChangesW , polling , DirectorySnapshot Requires: Python >=3.9 Provides-Extra: watchmedo Classifiers Deve
Using 1Password makes it easy for your employees to stay safe online. The most secure password manager for your business. 1Password is a secure, scalable, and easy-to-use password manager that's trusted by the world's leading companies. Using 1Password makes it easy for your employees to stay safe online. Once 1Password is part of their workflow, good security habits will become second nature. 1Pa
この記事読んで以来、ずっとTitaniumをいじっていました Ruby,Python,PHP,JavaScriptでマルチプラットフォームなデスクトップアプリを簡単に作成する Appcelerator Titanium Desktop - 仙台 Rails Vim JavaScript社長 Titanium Desktopの何がすごいって、Webkitベースなのでhtml/css/javascriptのweb標準技術が使えて、さらにはKrollというライブラリがそれぞれの言語の仲立ちをし、名前空間を共有しそれぞれのライブラリを呼び出せるそうな。なにそれきもい。 僕は完全に が使えるwebkitとしか見てなくて、GUIライブラリが貧弱なPythonだと、十分有力な選択肢に入ると思われます。一度作ったものはクロスブラウザで使えるし。 簡単なTwitterクライアントを作ってみた あっさりできま
Supervisor とはプロセス監視用のスーパーサーバです。同じ種類のプロセス監視サーバではdaemontoolsがあります。 Supervisorはpythonで書かれたおりXML-RPCを使って監視プロセスの情報を取得したり操作を行うことが出来ます。 今回はPSGIで書かれたplackアプリケーション(hello.psgi)を Supervisor を使ってデプロイしてみる。 インストール FreeBSDではportinstallで簡単インストールできます $ sudo portinstall sysutils/py-supervisor supervisorの自動起動設定 /etc/rc.conf supervisord_enable="YES" supervisor config設定 configの詳しい解説は公式サイトを見てください。 設定参考例 /usr/local/etc/
1. エスケープシーケンスにより表現する文字 Python で、バックスラッシュを文字列として出力したい。 print r'\' しかし、これではシンタックスエラーとなる。 他の言語と同様に、特定の文字の前にバックスラッシュ (\) を付けると、特殊な文字や機能を表わす。 例えば、「改行」を文字列の中に含むには、\n を記述する。 print 'hoge\npiyo' 文字列を出力させた結果は、 hoge piyo `\n’ は改行を表わし、これをエスケープシーケンスと言う。 エスケープシーケンス - Wikipedia とは、 コンピュータシステムにおいて、通常の文字列では表せない特殊な文字や機能を、規定された特別な文字の並びにより表したもの。狭義には、エスケープコード (0x1B, ESC) に始まる一連のバイト列のことをいう。 エスケープシーケンスとして、他に以下のような種類がある。
Python Basics Python - Home Python - Overview Python - History Python - Features Python vs C++ Python - Hello World Program Python - Application Areas Python - Interpreter Python - Environment Setup Python - Virtual Environment Python - Basic Syntax Python - Variables Python - Data Types Python - Type Casting Python - Unicode System Python - Literals Python - Operators Python - Arithmetic Operator
The profile module provides APIs for collecting and analyzing statistics about how Python source consumes processor resources. Note This output reports in this section have been reformatted to fit on the page. Lines ending with backslash (\) are continued on the next line. Running the Profiler¶ The most basic starting point in the profile module is run(). It takes a string statement as argument, a
pythonでデーモンを書きたいと思って、調べてみると「Pythonでprefork型のデーモンを書く」という記事を見つけました。この内容が素晴しくて、プロセスもデーモンも初心者な僕でも処理の大枠を理解できました。 それで、デーモン化する為のモジュールってあるんじゃないのと思いpypiを見てみると、複数のモジュールが登録されていました。その中で一番リッチな機能を持つDaemonContextを使ってみる事にしました。 インストールはeasy_installで一発です。 $ easy_install python-daemon 使い方も簡単でDaemonContextオブジェクトを作成して、そのwith構文中がDaemon化されます。 #!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import with_statement
CentOS 5.6 も Python は 2.4 なの!— Hajime Nakagami (@hajime_nakagami) 2011, 4月 8 Twitter を眺めていると、こういった声をちらほら聞くのでその対策をまとめてみます。 背景 CentOS 5.x で標準インストールされている Python のバージョンは 2.4.3 です。現在の Python 2 の最新バージョンは 2.7.1 であり、Good night, Posterous でも 2.6 以上を使うことが良さそうだと伺えます。私も個人的なアプリケーションを書くときは、2.4 を見限って 2.6 以上で書いています。私が 2.6 以上で使うようになったものとしては、構文では標準で提供されるようになった with 文 や、クラスデコレータ などがあります。標準ライブラリでは、abc, io, json, mult
node.js なサーバデーモンの管理をしようと思い、何を使おうか検討していたのですが、この手のデファクトスタンダードである daemontools は、特定のディレクトリ構造に従わないといけなかったり、run スクリプトや log/run スクリプトを置いたりしきゃいけなかったりで、余計な作業が多くてお手軽じゃない、ってことで runit を見てみたんですが、ぱっと見 daemontools との違いがよくわからなくて、daemontools とそれほど煩雑さは変わらないように見えたので、もっとお手軽なものがないかと探していたところ見つけたのが Supervisor 。(といっても自分が知らなかっただけで以前からあるみたいですが。) Python 製で easy_install 一発でインストールできる。 $ sudo easy_install supervisor デフォルトの設定フ
Claude Code GitHub Actionsを使っていて、自分は以下のような2種類のタスクを依頼することが多い。 実装計画を立ててもらう 実装をしてもらう Claude Codeであれば実装計画はOpusを使って、実装タスクはSonnetを使うみたいな使い分けが簡単にできるのにClaude Code GitHub Actionsではデフォルトだとそれができなかったのでちょっとやってみた。 具体的には、以下のようなclaude.ymlのWorkflowファイルを追加して、GitHub Issueなどのコメントで @claude このタスクの実装計画を Opus で立てて とコメント内にopus, sonnet, haiku のキーワードを含めることで指定したモデルでClaudeが動くようになる。 やっていることは単純で、メッセージ内にopusなどのキーワードをgrepで引っ掛けてmo
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く