As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit t….
I currently have a few unit tests which share a common set of tests. Here’s an example:
print ‘Calling BaseTest:testCommon’
value = 5
print ‘Calling SubTest1….
Let’s say I have a bunch of tests:
Is there a decorator or something similar that I could add to the functions to prevent pytest from running just that test? The result might look something like…
Can anyone tell me why this isn’t working?
>>> import mock
… def today(cls):
… return date(2010, 1, 1)
>>> from datetime import date
datetime.date(2010, 12, 19)
Perhaps someone could suggest a better way?
I’ve a python script which works just as it should, but I need to write the execution time. I’ve googled that I should use timeit but I can’t seem to get it to work.
My Python script looks like this:
from string import maketrans
myfile = open(“result….
I have a directory that contains my Python unit tests. Each unit test module is of the form test_*.py. I am attempting to make a file called all_test.py that will, you guessed it, run all files in the aforementioned test form and return the result. I have tried two methods so far; both have failed. I will show the two methods, and I hope someone o….
except ZeroDivisionError as exc:
================================ test session starts =================================
platform linux2 — Python 2.7.3 — py-1.4.20 — pytest-2.5…..