Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
13c5b05
Hard reset + cherry piciking the changes.
idomic Feb 11, 2020
fdecdf0
📜🤖 Added by blurb_it.
blurb-it[bot] Feb 11, 2020
29d13c9
Added @vstinner News
idomic Feb 12, 2020
135259f
Update Misc/NEWS.d/next/Library/2020-02-11-13-01-38.bpo-38691.oND8Sk.rst
idomic Feb 13, 2020
794b948
Merge branch 'master' of https://github.com/python/cpython
idomic Feb 15, 2020
bfa3cd1
Merge branch 'master' of https://github.com/python/cpython
idomic Feb 16, 2020
36b41eb
[bpo-10572] Moved tests of these modules under Lib/tests/MODULE_NAME_…
idomic Feb 16, 2020
69ad225
[bpo-10572] Changing test references for CI
idomic Feb 16, 2020
8e7db7a
[bpo-10572] Adapting tests imports
idomic Feb 16, 2020
71b4de5
Merge branch 'master' of https://github.com/python/cpython
idomic Feb 16, 2020
4be42f0
Removed residues
idomic Feb 16, 2020
4a3cf9f
Merge branch 'master' into bpo-10572-reArranging_Lib_tests
idomic Feb 16, 2020
18c5f36
[bpo-10572] Changed Makefile.pre.in to contain the correct tests path
idomic Feb 16, 2020
60a14df
📜🤖 Added by blurb_it.
blurb-it[bot] Feb 16, 2020
fbd63a8
[bpo-10572] Changed Makefile.pre.in to contain the correct tests path
idomic Feb 16, 2020
e3ff1cd
Merge remote-tracking branch 'origin/bpo-10572-reArranging_Lib_tests'…
idomic Feb 16, 2020
bb4e8b8
[bpo-10572] Changed Makefile.pre.in to contain the correct tests path
idomic Feb 16, 2020
65db1d2
[bpo-10572] Fixing distutils tests path
idomic Feb 16, 2020
7cfa472
[bpo-10572] Fixing Lib.test.tkinter_test tests path
idomic Feb 16, 2020
fd7ed2b
[bpo-10572] Fixing Lib.test.unittest_test + ctypes tests path
idomic Feb 16, 2020
6b32dd1
[bpo-10572] Fixing Lib.test.unittest_test + test_lib2to3 tests path
idomic Feb 17, 2020
1021fcf
[bpo-10572] Fixing Lib.test.unittest_test + test_lib2to3 tests path
idomic Feb 17, 2020
f5431d8
[bpo-10572] Fixed hardcoded Lib.test.unittest_test and lib2to3 path
idomic Feb 17, 2020
d89915f
[bpo-10572] Fixed hardcoded Lib.test.unittest_test and lib2to3 path
idomic Feb 17, 2020
a5e9500
[bpo-10572] Fixed hardcoded Lib.test.unittest_test and lib2to3 path
idomic Feb 17, 2020
19ab4cd
[bpo-10572] Fixed hardcoded Lib.test.unittest_test and lib2to3 path
idomic Feb 17, 2020
1010154
[bpo-10572] Fixed hardcoded Lib.test.unittest_test and lib2to3 path
idomic Feb 17, 2020
e65b43c
[bpo-10572] Fixed hardcoded Lib.test.unittest_test and lib2to3 path
idomic Feb 17, 2020
4609963
[bpo-10572] Fixed hardcoded Lib.test.unittest_test and lib2to3 path
idomic Feb 17, 2020
c552264
[bpo-10572] Fixed hardcoded Lib.test.unittest_test and lib2to3 path
idomic Feb 17, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[bpo-10572] Fixed hardcoded Lib.test.unittest_test and lib2to3 path
  • Loading branch information
idomic committed Feb 17, 2020
commit 46099635c8b54fd8b144eecab6fd1ab3f8f3fedd
14 changes: 7 additions & 7 deletions Lib/test/lib2to3_tests/test_refactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,10 @@ class SimpleFix(fixer_base.BaseFix):
self.assertEqual(fixes, [no_head])

def test_fixer_loading(self):
from myfixes.fix_first import FixFirst
from myfixes.fix_last import FixLast
from myfixes.fix_parrot import FixParrot
from myfixes.fix_preorder import FixPreorder
from .data.fixers.myfixes.fix_first import FixFirst
from .data.fixers.myfixes.fix_last import FixLast
from .data.fixers.myfixes.fix_parrot import FixParrot
from .data.fixers.myfixes.fix_preorder import FixPreorder

rt = self.rt()
pre, post = rt.get_fixers()
Expand Down Expand Up @@ -324,12 +324,12 @@ def test_refactor_docstring(self):
self.assertNotEqual(out, doc)

def test_explicit(self):
from myfixes.fix_explicit import FixExplicit
from .data.fixers.myfixes.fix_explicit import FixExplicit

rt = self.rt(fixers=["myfixes.fix_explicit"])
rt = self.rt(fixers=[".data.fixers.myfixes.fix_explicit"])
self.assertEqual(len(rt.post_order), 0)

rt = self.rt(explicit=["myfixes.fix_explicit"])
rt = self.rt(explicit=[".data.fixers.myfixes.fix_explicit"])
for fix in rt.post_order:
if isinstance(fix, FixExplicit):
break
Expand Down
6 changes: 3 additions & 3 deletions Lib/test/unittest_test/test_discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import unittest
import unittest.mock
import Lib.test.unittest_test
import Lib.test.unittest_test as unittest_test


class TestableTestProgram(unittest.TestProgram):
Expand Down Expand Up @@ -788,15 +788,15 @@ def test_discovery_from_dotted_path(self):
loader = unittest.TestLoader()

tests = [self]
expectedPath = os.path.abspath(os.path.dirname(unittest.test.__file__))
expectedPath = os.path.abspath(os.path.dirname(unittest_test.__file__))

self.wasRun = False
def _find_tests(start_dir, pattern, namespace=None):
self.wasRun = True
self.assertEqual(start_dir, expectedPath)
return tests
loader._find_tests = _find_tests
suite = loader.discover('unittest.test')
suite = loader.discover('Lib.test.unittest_test')
self.assertTrue(self.wasRun)
self.assertEqual(suite._tests, tests)

Expand Down
2 changes: 1 addition & 1 deletion Lib/test/unittest_test/testmock/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def load_tests(*args):
suite = unittest.TestSuite()
for fn in os.listdir(here):
if fn.startswith("test") and fn.endswith(".py"):
modname = "unittest.test.testmock." + fn[:-3]
modname = "Lib.test.unittest_test.testmock." + fn[:-3]
__import__(modname)
module = sys.modules[modname]
suite.addTest(loader.loadTestsFromModule(module))
Expand Down