diff options
author | Stephanie Marcu <stephanie.marcu@logilab.fr> | 2008-05-23 14:14:59 +0200 |
---|---|---|
committer | Stephanie Marcu <stephanie.marcu@logilab.fr> | 2008-05-23 14:14:59 +0200 |
commit | 41af233d81a1cd1d86b75f23a2c0cb48235bbfc7 (patch) | |
tree | a25469088ba1117096539b70afd1e8e6e38a8b24 /pytest.py | |
parent | c2b9b7c5652a88072fbaf509d846a80fd92d3a7b (diff) | |
download | logilab-common-41af233d81a1cd1d86b75f23a2c0cb48235bbfc7.tar.gz |
consider the current directory as a test dir even if its name is not test or tests
Diffstat (limited to 'pytest.py')
-rw-r--r-- | pytest.py | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -300,7 +300,8 @@ class PyTester(object): """walks trhough current working directory, finds something which can be considered as a testdir and runs every test there """ - for dirname, dirs, files in os.walk(os.getcwd()): + here = os.getcwd() + for dirname, dirs, _ in os.walk(here): for skipped in ('CVS', '.svn', '.hg'): if skipped in dirs: dirs.remove(skipped) @@ -310,7 +311,11 @@ class PyTester(object): # we found a testdir, let's explore it ! self.testonedir(dirname, exitfirst) dirs[:] = [] - + if self.report.ran == 0: + # if no test was found during the visit, consider + # the local directory as a test directory even if + # it doesn't have a traditional test directory name + self.testonedir(here) def testonedir(self, testdir, exitfirst=False): """finds each testfile in the `testdir` and runs it""" |