summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikita Sobolev <mail@sobolevn.me>2023-09-15 07:52:24 (GMT)
committerGitHub <noreply@github.com>2023-09-15 07:52:24 (GMT)
commit82505dc351b2f7e37aa395218709b432d83292cd (patch)
tree9a1358debc0c54136b24857261cff9fb34ff5364
parentfa493900fbf19cbfac44164f3d8acb4f598ff3c1 (diff)
downloadcpython-82505dc351b2f7e37aa395218709b432d83292cd.zip
cpython-82505dc351b2f7e37aa395218709b432d83292cd.tar.gz
cpython-82505dc351b2f7e37aa395218709b432d83292cd.tar.bz2
gh-108303: Move `test_future` into its own test_future_stmt subdir (#109368)
-rw-r--r--Lib/test/libregrtest/findtests.py1
-rw-r--r--Lib/test/test_future_stmt/__init__.py6
-rw-r--r--Lib/test/test_future_stmt/badsyntax_future10.py (renamed from Lib/test/badsyntax_future10.py)0
-rw-r--r--Lib/test/test_future_stmt/badsyntax_future3.py (renamed from Lib/test/badsyntax_future3.py)0
-rw-r--r--Lib/test/test_future_stmt/badsyntax_future4.py (renamed from Lib/test/badsyntax_future4.py)0
-rw-r--r--Lib/test/test_future_stmt/badsyntax_future5.py (renamed from Lib/test/badsyntax_future5.py)0
-rw-r--r--Lib/test/test_future_stmt/badsyntax_future6.py (renamed from Lib/test/badsyntax_future6.py)0
-rw-r--r--Lib/test/test_future_stmt/badsyntax_future7.py (renamed from Lib/test/badsyntax_future7.py)0
-rw-r--r--Lib/test/test_future_stmt/badsyntax_future8.py (renamed from Lib/test/badsyntax_future8.py)0
-rw-r--r--Lib/test/test_future_stmt/badsyntax_future9.py (renamed from Lib/test/badsyntax_future9.py)0
-rw-r--r--Lib/test/test_future_stmt/future_test1.py (renamed from Lib/test/future_test1.py)0
-rw-r--r--Lib/test/test_future_stmt/future_test2.py (renamed from Lib/test/future_test2.py)0
-rw-r--r--Lib/test/test_future_stmt/test_future.py (renamed from Lib/test/test_future.py)48
-rw-r--r--Lib/test/test_future_stmt/test_future_flags.py (renamed from Lib/test/test___future__.py)0
-rw-r--r--Lib/test/test_future_stmt/test_future_multiple_features.py (renamed from Lib/test/test_future5.py)0
-rw-r--r--Lib/test/test_future_stmt/test_future_multiple_imports.py (renamed from Lib/test/test_future4.py)0
-rw-r--r--Lib/test/test_future_stmt/test_future_single_import.py (renamed from Lib/test/test_future3.py)0
-rw-r--r--Makefile.pre.in1
18 files changed, 37 insertions, 19 deletions
diff --git a/Lib/test/libregrtest/findtests.py b/Lib/test/libregrtest/findtests.py
index 6f554ad..60f2198 100644
--- a/Lib/test/libregrtest/findtests.py
+++ b/Lib/test/libregrtest/findtests.py
@@ -18,6 +18,7 @@ from .utils import (
SPLITTESTDIRS: set[TestName] = {
"test_asyncio",
"test_concurrent_futures",
+ "test_future_stmt",
"test_multiprocessing_fork",
"test_multiprocessing_forkserver",
"test_multiprocessing_spawn",
diff --git a/Lib/test/test_future_stmt/__init__.py b/Lib/test/test_future_stmt/__init__.py
new file mode 100644
index 0000000..f2a39a3
--- /dev/null
+++ b/Lib/test/test_future_stmt/__init__.py
@@ -0,0 +1,6 @@
+import os
+from test import support
+
+
+def load_tests(*args):
+ return support.load_package_tests(os.path.dirname(__file__), *args)
diff --git a/Lib/test/badsyntax_future10.py b/Lib/test/test_future_stmt/badsyntax_future10.py
index fa5ab67..fa5ab67 100644
--- a/Lib/test/badsyntax_future10.py
+++ b/Lib/test/test_future_stmt/badsyntax_future10.py
diff --git a/Lib/test/badsyntax_future3.py b/Lib/test/test_future_stmt/badsyntax_future3.py
index f1c8417..f1c8417 100644
--- a/Lib/test/badsyntax_future3.py
+++ b/Lib/test/test_future_stmt/badsyntax_future3.py
diff --git a/Lib/test/badsyntax_future4.py b/Lib/test/test_future_stmt/badsyntax_future4.py
index b5f4c98..b5f4c98 100644
--- a/Lib/test/badsyntax_future4.py
+++ b/Lib/test/test_future_stmt/badsyntax_future4.py
diff --git a/Lib/test/badsyntax_future5.py b/Lib/test/test_future_stmt/badsyntax_future5.py
index 8a7e5fc..8a7e5fc 100644
--- a/Lib/test/badsyntax_future5.py
+++ b/Lib/test/test_future_stmt/badsyntax_future5.py
diff --git a/Lib/test/badsyntax_future6.py b/Lib/test/test_future_stmt/badsyntax_future6.py
index 5a8b55a..5a8b55a 100644
--- a/Lib/test/badsyntax_future6.py
+++ b/Lib/test/test_future_stmt/badsyntax_future6.py
diff --git a/Lib/test/badsyntax_future7.py b/Lib/test/test_future_stmt/badsyntax_future7.py
index 131db2c..131db2c 100644
--- a/Lib/test/badsyntax_future7.py
+++ b/Lib/test/test_future_stmt/badsyntax_future7.py
diff --git a/Lib/test/badsyntax_future8.py b/Lib/test/test_future_stmt/badsyntax_future8.py
index ca45289..ca45289 100644
--- a/Lib/test/badsyntax_future8.py
+++ b/Lib/test/test_future_stmt/badsyntax_future8.py
diff --git a/Lib/test/badsyntax_future9.py b/Lib/test/test_future_stmt/badsyntax_future9.py
index 916de06..916de06 100644
--- a/Lib/test/badsyntax_future9.py
+++ b/Lib/test/test_future_stmt/badsyntax_future9.py
diff --git a/Lib/test/future_test1.py b/Lib/test/test_future_stmt/future_test1.py
index 297c2e0..297c2e0 100644
--- a/Lib/test/future_test1.py
+++ b/Lib/test/test_future_stmt/future_test1.py
diff --git a/Lib/test/future_test2.py b/Lib/test/test_future_stmt/future_test2.py
index 3d7fc86..3d7fc86 100644
--- a/Lib/test/future_test2.py
+++ b/Lib/test/test_future_stmt/future_test2.py
diff --git a/Lib/test/test_future.py b/Lib/test/test_future_stmt/test_future.py
index 4730bfa..8e67bcd 100644
--- a/Lib/test/test_future.py
+++ b/Lib/test/test_future_stmt/test_future.py
@@ -25,57 +25,71 @@ class FutureTest(unittest.TestCase):
self.assertEqual(err.offset, offset)
def test_future1(self):
- with import_helper.CleanImport('future_test1'):
- from test import future_test1
+ with import_helper.CleanImport('test.test_future_stmt.future_test1'):
+ from test.test_future_stmt import future_test1
self.assertEqual(future_test1.result, 6)
def test_future2(self):
- with import_helper.CleanImport('future_test2'):
- from test import future_test2
+ with import_helper.CleanImport('test.test_future_stmt.future_test2'):
+ from test.test_future_stmt import future_test2
self.assertEqual(future_test2.result, 6)
- def test_future3(self):
- with import_helper.CleanImport('test_future3'):
- from test import test_future3
+ def test_future_single_import(self):
+ with import_helper.CleanImport(
+ 'test.test_future_stmt.test_future_single_import',
+ ):
+ from test.test_future_stmt import test_future_single_import
+
+ def test_future_multiple_imports(self):
+ with import_helper.CleanImport(
+ 'test.test_future_stmt.test_future_multiple_imports',
+ ):
+ from test.test_future_stmt import test_future_multiple_imports
+
+ def test_future_multiple_features(self):
+ with import_helper.CleanImport(
+ "test.test_future_stmt.test_future_multiple_features",
+ ):
+ from test.test_future_stmt import test_future_multiple_features
def test_badfuture3(self):
with self.assertRaises(SyntaxError) as cm:
- from test import badsyntax_future3
+ from test.test_future_stmt import badsyntax_future3
self.check_syntax_error(cm.exception, "badsyntax_future3", 3)
def test_badfuture4(self):
with self.assertRaises(SyntaxError) as cm:
- from test import badsyntax_future4
+ from test.test_future_stmt import badsyntax_future4
self.check_syntax_error(cm.exception, "badsyntax_future4", 3)
def test_badfuture5(self):
with self.assertRaises(SyntaxError) as cm:
- from test import badsyntax_future5
+ from test.test_future_stmt import badsyntax_future5
self.check_syntax_error(cm.exception, "badsyntax_future5", 4)
def test_badfuture6(self):
with self.assertRaises(SyntaxError) as cm:
- from test import badsyntax_future6
+ from test.test_future_stmt import badsyntax_future6
self.check_syntax_error(cm.exception, "badsyntax_future6", 3)
def test_badfuture7(self):
with self.assertRaises(SyntaxError) as cm:
- from test import badsyntax_future7
+ from test.test_future_stmt import badsyntax_future7
self.check_syntax_error(cm.exception, "badsyntax_future7", 3, 54)
def test_badfuture8(self):
with self.assertRaises(SyntaxError) as cm:
- from test import badsyntax_future8
+ from test.test_future_stmt import badsyntax_future8
self.check_syntax_error(cm.exception, "badsyntax_future8", 3)
def test_badfuture9(self):
with self.assertRaises(SyntaxError) as cm:
- from test import badsyntax_future9
+ from test.test_future_stmt import badsyntax_future9
self.check_syntax_error(cm.exception, "badsyntax_future9", 3)
def test_badfuture10(self):
with self.assertRaises(SyntaxError) as cm:
- from test import badsyntax_future10
+ from test.test_future_stmt import badsyntax_future10
self.check_syntax_error(cm.exception, "badsyntax_future10", 3)
def test_ensure_flags_dont_clash(self):
@@ -113,10 +127,6 @@ class FutureTest(unittest.TestCase):
else:
self.fail("syntax error didn't occur")
- def test_multiple_features(self):
- with import_helper.CleanImport("test.test_future5"):
- from test import test_future5
-
def test_unicode_literals_exec(self):
scope = {}
exec("from __future__ import unicode_literals; x = ''", {}, scope)
diff --git a/Lib/test/test___future__.py b/Lib/test/test_future_stmt/test_future_flags.py
index 559a187..559a187 100644
--- a/Lib/test/test___future__.py
+++ b/Lib/test/test_future_stmt/test_future_flags.py
diff --git a/Lib/test/test_future5.py b/Lib/test/test_future_stmt/test_future_multiple_features.py
index b44b97e..b44b97e 100644
--- a/Lib/test/test_future5.py
+++ b/Lib/test/test_future_stmt/test_future_multiple_features.py
diff --git a/Lib/test/test_future4.py b/Lib/test/test_future_stmt/test_future_multiple_imports.py
index b27ca40..b27ca40 100644
--- a/Lib/test/test_future4.py
+++ b/Lib/test/test_future_stmt/test_future_multiple_imports.py
diff --git a/Lib/test/test_future3.py b/Lib/test/test_future_stmt/test_future_single_import.py
index 09f1c78..09f1c78 100644
--- a/Lib/test/test_future3.py
+++ b/Lib/test/test_future_stmt/test_future_single_import.py
diff --git a/Makefile.pre.in b/Makefile.pre.in
index 922c9d7..ba35e1b 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -2160,6 +2160,7 @@ TESTSUBDIRS= idlelib/idle_test \
test/test_dataclasses \
test/test_email \
test/test_email/data \
+ test/test_future_stmt \
test/test_import \
test/test_import/data \
test/test_import/data/circular_imports \