This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mdjonyhossainhabib
Recipients Claudiu.Popa, Florian.Apolloner, Zbynek.Winkler, ashkop, docs@python, eric.snow, ezio.melotti, mdjonyhossainhabib, methane, michael.foord, miss-islington, pconnell, rbcollins, rgammans, rgammans@gammascience.co.uk, terry.reedy
Date 2021-02-22.20:14:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1614024868.07.0.998554578611.issue23882@roundup.psfhosted.org>
In-reply-to
Content
diff -r 293d9964cf6e Lib/unittest/loader.py
--- a/Lib/unittest/loader.py	Tue Apr 28 00:04:53 2015 -0400
+++ b/Lib/unittest/loader.py	Tue Apr 28 10:12:07 2015 +0300
@@ -338,7 +338,7 @@
             raise ImportError('Start directory is not importable: %r' % start_dir)
 
         if not is_namespace:
-            tests = list(self._find_tests(start_dir, pattern))
+            tests = list(self._find_tests(start_dir, pattern, namespace=True))
         return self.suiteClass(tests)
 
     def _get_directory_containing_module(self, module_name):
@@ -403,7 +403,7 @@
                 name = self._get_name_from_path(full_path)
                 self._loading_packages.add(name)
                 try:
-                    yield from self._find_tests(full_path, pattern, namespace)
+                    yield from self._find_tests(full_path, pattern, False)
                 finally:
                     self._loading_packages.discard(name)
 
diff -r 293d9964cf6e Lib/unittest/test/test_program.py
--- a/Lib/unittest/test/test_program.py	Tue Apr 28 00:04:53 2015 -0400
+++ b/Lib/unittest/test/test_program.py	Tue Apr 28 10:12:07 2015 +0300
@@ -16,7 +16,7 @@
         expectedPath = os.path.abspath(os.path.dirname(unittest.test.__file__))
 
         self.wasRun = False
-        def _find_tests(start_dir, pattern):
+        def _find_tests(start_dir, pattern, namespace):
             self.wasRun = True
             self.assertEqual(start_dir, expectedPath)
             return tests
History
Date User Action Args
2021-02-22 20:14:28mdjonyhossainhabibsetrecipients: + mdjonyhossainhabib, terry.reedy, rbcollins, ezio.melotti, michael.foord, methane, rgammans, docs@python, Claudiu.Popa, Zbynek.Winkler, eric.snow, pconnell, Florian.Apolloner, ashkop, miss-islington, rgammans@gammascience.co.uk
2021-02-22 20:14:28mdjonyhossainhabibsetmessageid: <1614024868.07.0.998554578611.issue23882@roundup.psfhosted.org>
2021-02-22 20:14:28mdjonyhossainhabiblinkissue23882 messages
2021-02-22 20:14:27mdjonyhossainhabibcreate