¡@

Home 

python Programming Glossary: tests

How can I profile a SQLAlchemy powered application?

http://stackoverflow.com/questions/1171166/how-can-i-profile-a-sqlalchemy-powered-application

example of SQLAlchemy profiling within the SQLAlchemy unit tests if you poke around http www.sqlalchemy.org trac browser sqlalchemy.. sqlalchemy trunk test aaa_profiling . There we have tests using decorators that assert a maximum number of method calls.. so that if something inefficient gets checked in the tests will reveal it it is important to note that in Python function..

Is there a difference between `==` and `is` in python?

http://stackoverflow.com/questions/132988/is-there-a-difference-between-and-is-in-python

if n 5 print 'Yay ' # Test two. if n is 5 print 'Yay ' two tests for equality equivalent ha Does this hold true for objects where.. ' # Holds true but... if L is 1 print 'Yay ' # Doesn't. So tests value where is tests to see if they are the same object python.. if L is 1 print 'Yay ' # Doesn't. So tests value where is tests to see if they are the same object python reference semantic..

Force Python to forego native sqlite3 and use the (installed) latest sqlite3 version

http://stackoverflow.com/questions/1545479/force-python-to-forego-native-sqlite3-and-use-the-installed-latest-sqlite3-ver

sudo path to python2.x setup.py install and run the tests cd # somewhere out of the build directory path to python2.x..

Is `import module` better coding style than `from module import function`?

http://stackoverflow.com/questions/1744258/is-import-module-better-coding-style-than-from-module-import-function

mentioned here Pros for IM ease of mocking injecting in tests. I am not very familiar with mocking though I recently learned.. repeat the mocking over and over and over again. Making tests perfectly repeatable typically also requires coordinated mocking..

What is the best project structure for a Python application?

http://stackoverflow.com/questions/193161/what-is-the-best-project-structure-for-a-python-application

the IDE project cruft Where do you put the unit acceptance tests Where do you put non Python data such as config files Where.. or bin for that kind of command line interface stuff tests for your tests lib for your C language libraries doc for most.. that kind of command line interface stuff tests for your tests lib for your C language libraries doc for most documentation..

In Python, how do I determine if an object is iterable?

http://stackoverflow.com/questions/1952464/in-python-how-do-i-determine-if-an-object-is-iterable

by allowing polymorphic substitution. Duck typing avoids tests using type or isinstance . Instead it typically employs the..

Fastest way to list all primes below N in python

http://stackoverflow.com/questions/2068372/fastest-way-to-list-all-primes-below-n-in-python

n test sieveOfAtkin rwh_primes2 n Running the script tests that all implementations give the same result. share improve..

error: Unable to find vcvarsall.bat

http://stackoverflow.com/questions/2817869/error-unable-to-find-vcvarsall-bat

creating build creating build lib.win32 2.6 dulwich tests running build_ext building 'dulwich._objects' extension error..

How is the 'is' keyword implemented in Python?

http://stackoverflow.com/questions/2987958/how-is-the-is-keyword-implemented-in-python

the strings you should never use is on strings. is tests for identity not equality . That means Python simply compares..

How to generate dynamic (parametrized) unit tests in python?

http://stackoverflow.com/questions/32899/how-to-generate-dynamic-parametrized-unit-tests-in-python

to generate dynamic parametrized unit tests in python I have some kind of test data and want to create.. a bar a b lee b b class TestSequence unittest.TestCase def testsample self for name a b in l print test name self.assertEqual..

Are there any static analysis tools for Python?

http://stackoverflow.com/questions/35470/are-there-any-static-analysis-tools-for-python

AST. Obviously testing is important and I don't imply that tests can be obviated entirely however there are many runtime errors..

Python - Parse a .py file, read the AST, modify it, then write back the modified source code

http://stackoverflow.com/questions/768634/python-parse-a-py-file-read-the-ast-modify-it-then-write-back-the-modified

python mostly by deleting statements expressions rerunning tests and seeing what breaks. python compiler source code source..

Unit and functional testing a PySide-based application?

http://stackoverflow.com/questions/11145583/unit-and-functional-testing-a-pyside-based-application

it is supposed to do class Test_PwsAddEntryDialog TestCase Tests the class PwsAddEntryDialog. def test_password_strength_checking_works.. def test_password_strength_checking_works self Tests if password strength checking works if the corresponding check.. QAbstractListModel class Test_SectionListModel TestCase Tests the class SectionListModel. def test_model_works_as_expected..

How to Mock an HTTP request in a unit testing scenario in Python

http://stackoverflow.com/questions/11399148/how-to-mock-an-http-request-in-a-unit-testing-scenario-in-python

from foo import core class HttpRequests unittest.TestCase Tests for HTTP def setUp self Starting a Web server self.port 8080.. list of CSS. import unittest from foo import core class CssTests unittest.TestCase Tests for CSS requests def setUp self self.css.. from foo import core class CssTests unittest.TestCase Tests for CSS requests def setUp self self.css core.Css self.req core.HttpRequests..

Python: Change values in dict of nested dicts using items in a list

http://stackoverflow.com/questions/11918852/python-change-values-in-dict-of-nested-dicts-using-items-in-a-list

reduce dict.get list_address 1 dict_nested list_address 1 Tests from collections import OrderedDict d OrderedDict set_value..

Using virtualenv with sublime text 2

http://stackoverflow.com/questions/11965707/using-virtualenv-with-sublime-text-2

project file and add the following build_systems name Run Tests cmd source path to your virtualenv bin activate working_dir..

Why python finds module instead of package if they have the same name?

http://stackoverflow.com/questions/14183541/why-python-finds-module-instead-of-package-if-they-have-the-same-name

import unittest from root.classes import Class1 class Tests unittest.TestCase pass root _ init _.py empty root classes.py.. unittest main.py line 149 in parseArgs self.createTests File usr lib python2.7 unittest main.py line 158 in createTests.. File usr lib python2.7 unittest main.py line 158 in createTests self.module File usr lib python2.7 unittest loader.py line 128..

Install PIL in Ubuntu 12.04 Python 2.7 and Python 3.2

http://stackoverflow.com/questions/15002538/install-pil-in-ubuntu-12-04-python-2-7-and-python-3-2

display.c _imagingcms.c path.c test docs _imagingft.c PIL Tests encode.c _imagingmath.c py3.h Tk github comments.txt _imagingtk.c..

Folder and file organization for Python development

http://stackoverflow.com/questions/1642975/folder-and-file-organization-for-python-development

class1 class2 subsystem1Module subsystem2 utils etc Tests Whatever etc Any suggestions Oh and please describe what are..

split a generator/iterable every n items in python (splitEvery)

http://stackoverflow.com/questions/1915170/split-a-generator-iterable-every-n-items-in-python-splitevery

as an input it should return a generator as an output Tests # should not enter infinite loop with generators or lists splitEvery..

How to serialize db.Model objects to json?

http://stackoverflow.com/questions/2114659/how-to-serialize-db-model-objects-to-json

all of App Engine's Property types. def default self obj Tests the input object obj to encode as JSON. if hasattr obj '__json__'..

How to get self into a Python method without explicitly accepting it

http://stackoverflow.com/questions/3453976/how-to-get-self-into-a-python-method-without-explicitly-accepting-it

testing framework basically unit tests for PDFs. Tests are decorated methods of instances of classes defined by the..

Remove empty strings from a list of strings

http://stackoverflow.com/questions/3845423/remove-empty-strings-from-a-list-of-strings

lambda item item str_list # slower than list comprehension Tests timeit 'filter None str_list ' 'str_list a 1000' number 100000..

How can I specify a database for Django Tests to use instead of having it build it everytime?

http://stackoverflow.com/questions/4606756/how-can-i-specify-a-database-for-django-tests-to-use-instead-of-having-it-build

can I specify a database for Django Tests to use instead of having it build it everytime I want to be..

Compiling Python 2.6.6 and need for external packages wxPython, setuptools, etc… in Ubuntu

http://stackoverflow.com/questions/6079128/compiling-python-2-6-6-and-need-for-external-packages-wxpython-setuptools-etc

setup.py backport python setup.py configure make cd .. Tests make cd .. Sources mkdir p TARG lib python2.7 site packages..

Strange path separators on Windows

http://stackoverflow.com/questions/6928789/strange-path-separators-on-windows

print len document It gives me a trackback D work Kindle Tests python.exe test.py Traceback most recent call last File test.py.. or filename 'D work Kindle srcs test1.html' D work Kindle Tests If I change the path line to path 'D work Kindle srcs test1.html'..