Linked Questions

0 votes
1 answer
987 views

I am running a set of unit tests using a Bash script. What is a more Pythonic way of doing this generally? Assuming I cannot change the unit tests, what would be the most Pythonic way of doing this? ...
d3pd's user avatar
  • 8,375
1033 votes
28 answers
473k views

The very common directory structure for even a simple Python module seems to be to separate the unit tests into their own test directory: new_project/ antigravity/ antigravity.py test/ ...
Major Major's user avatar
  • 10.8k
41 votes
5 answers
46k views

How do I run multiple Classes in a single test suite in Python using unit testing?
Prasanna Yelsangikar's user avatar
10 votes
6 answers
20k views

I have two module with two different classes and their corresponding test classes. foo.py ------ class foo(object): def fooMethod(self): // smthg bar.py ------ class bar(object): ...
caren vanderlee's user avatar
8 votes
6 answers
19k views

I am at my wits end with trying to get all my unittest to run in Python. I have searched about 30 different posts and the unit test documentation but still cannot figure it out. First I have two test ...
EliSquared's user avatar
  • 1,581
4 votes
4 answers
3k views

Using DJango/Python 3.7. I read here -- How do I run all Python unit tests in a directory? that I could use a "discover" command to find tests in a specified directory. I want to have a "tests" ...
Dave's user avatar
  • 20.1k
4 votes
1 answer
5k views

I am trying some Python with selenium, I have some defined tests in simpleUsageUnittest.py: import unittest import time from selenium import webdriver from selenium.webdriver.common.keys import Keys ...
hegelsturm's user avatar
0 votes
2 answers
1k views

Suppose I've got a few modules with test cases derived from unittest.TestCase. All those modules reside in one package test: test/ test_case1.py test_case2.py test_case3.py I'd like to run ...
Michael's user avatar
  • 42.2k
-1 votes
1 answer
3k views

There are lots of answers for test discovery in python 2.7+ but I need one for python 2.6.6. I've got such directory structure: root |-- runall.py |-- src | |-- a.py | |-- b.py |-- test |-- ...
Scony's user avatar
  • 4,158
4 votes
1 answer
2k views

I'm new to Python and I searched google a lot and read some articles about relative imports etc. Despite the fact that I am unable to get it working. Please, consider my following project structure: /...
kubisma1's user avatar
  • 317
-1 votes
1 answer
1k views

So I tried many things (from SO and more) getting my tests running but nothing worked this is my current code: test.py which I call to run the tests: python3 ./src/preprocess/python/test.py ...
rufreakde's user avatar
  • 652
0 votes
1 answer
2k views

I'm trying to write a testing script in python to test multiple files containing the same functions (coding assignments). I currently have a single test script that imports the file destined for ...
Dan's user avatar
  • 1
0 votes
1 answer
362 views

I have a folder containing several files starting with "test_" that each contain tests. How do I execute all the files, using py.test, under a single run, with Eclipse?
rbs's user avatar
  • 189
0 votes
3 answers
275 views

I'm doing a simple script to run and test my code. How can i import dinamically and run my test classes?
Heros's user avatar
  • 350
0 votes
1 answer
310 views

I have the following directory structure, as recommended in the pytest docs : setup.py src/ mypkg/ __init__.py app.py view.py tests/ __init__.py ...
Rose's user avatar
  • 2,819

15 30 50 per page