Linked Questions
17 questions linked to/from How do I run all Python unit tests in a directory?
0 votes
1 answer
987 views
how to run a set of Python unit tests [duplicate]
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? ...
1033 votes
28 answers
473k views
Running unittest with typical test directory structure
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/ ...
41 votes
5 answers
46k views
How do I run multiple Classes in a single test suite in Python using unit testing?
How do I run multiple Classes in a single test suite in Python using unit testing?
10 votes
6 answers
20k views
Is it possible to run all unit test?
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): ...
8 votes
6 answers
19k views
Run all tests from subdirectories in Python
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 ...
4 votes
4 answers
3k views
How do I use "discover" to run tests in my "tests" directory?
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" ...
4 votes
1 answer
5k views
AttributeError: 'TextTestResult' object has no attribute 'assertIn'
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 ...
0 votes
2 answers
1k views
How to run all tests with one shell command?
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 ...
-1 votes
1 answer
3k views
Python 2.6.6 unittest test discovery
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 |-- ...
4 votes
1 answer
2k views
Python project structure and relative imports
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: /...
-1 votes
1 answer
1k views
Python 3.7 Unit Tests
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 ...
0 votes
1 answer
2k views
Using python's unittest to test multiple files
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 ...
0 votes
1 answer
362 views
In Eclipse, how do I execute all files in a folder using py.test?
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?
0 votes
3 answers
275 views
Unit testing: How can i import test classes dynamically and run?
I'm doing a simple script to run and test my code. How can i import dinamically and run my test classes?
0 votes
1 answer
310 views
Python - Running unit and integration tests with standard directory structure
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 ...