Here's the diff that's needed to go from the 3.7 version to 3.6, and
from using Python's "-m test" to using "PYTHONPATH=. python3.6 test/test_dataclasses.py".

diff -u ../python/cpython/Lib/dataclasses.py .
--- ../python/cpython/Lib/dataclasses.py	2018-05-16 14:11:43.000000000 -0400
+++ ./dataclasses.py	2018-05-16 16:24:10.000000000 -0400
@@ -547,9 +547,7 @@
 def _is_classvar(a_type, typing):
     # This test uses a typing internal class, but it's the best way to
     # test if this is a ClassVar.
-    return (a_type is typing.ClassVar
-            or (type(a_type) is typing._GenericAlias
-                and a_type.__origin__ is typing.ClassVar))
+    return type(a_type) is typing._ClassVar
 
 
 def _is_initvar(a_type, dataclasses):
diff -u ../python/cpython/Lib/test/test_dataclasses.py test
--- ../python/cpython/Lib/test/test_dataclasses.py	2018-05-16 11:32:13.000000000 -0400
+++ test/test_dataclasses.py	2018-05-16 16:14:43.000000000 -0400
@@ -666,7 +666,7 @@
         self.assertNotEqual(Point3D(1, 2, 3), (1, 2, 3))
 
         # Make sure we can't unpack.
-        with self.assertRaisesRegex(TypeError, 'unpack'):
+        with self.assertRaisesRegex(TypeError, 'is not iterable'):
             x, y, z = Point3D(4, 5, 6)
 
         # Make sure another class with the same field names isn't
@@ -2051,7 +2051,7 @@
         @dataclass(repr=False)
         class C:
             x: int
-        self.assertIn('test_dataclasses.TestRepr.test_no_repr.<locals>.C object at',
+        self.assertIn('.TestRepr.test_no_repr.<locals>.C object at',
                       repr(C(3)))
 
         # Test a class with a __repr__ and repr=False.
@@ -2798,10 +2798,10 @@
                 self.assertEqual(C(10).x, 10)
 
     def test_classvar_module_level_import(self):
-        from . import dataclass_module_1
-        from . import dataclass_module_1_str
-        from . import dataclass_module_2
-        from . import dataclass_module_2_str
+        import dataclass_module_1
+        import dataclass_module_1_str
+        import dataclass_module_2
+        import dataclass_module_2_str
 
         for m in (dataclass_module_1, dataclass_module_1_str,
                   dataclass_module_2, dataclass_module_2_str,
@@ -2971,7 +2971,7 @@
                     make_dataclass('C', [field, 'a', field])
 
     def test_keyword_field_names(self):
-        for field in ['for', 'async', 'await', 'as']:
+        for field in ['for', 'as', 'import']:
             with self.subTest(field=field):
                 with self.assertRaisesRegex(TypeError, 'must not be keywords'):
                     make_dataclass('C', ['a', field])
diff -u ../python/cpython/Lib/test/dataclass_module_1.py test
diff -u ../python/cpython/Lib/test/dataclass_module_1_str.py test
--- ../python/cpython/Lib/test/dataclass_module_1_str.py	2018-05-16 06:50:50.000000000 -0400
+++ test/dataclass_module_1_str.py	2018-05-16 16:23:19.000000000 -0400
@@ -1,4 +1,4 @@
-from __future__ import annotations
+#from __future__ import annotations
 USING_STRINGS = True
 
 # dataclass_module_1.py and dataclass_module_1_str.py are identical
@@ -15,18 +15,18 @@
 
 @dataclasses.dataclass
 class CV:
-    T_CV4 = typing.ClassVar
-    cv0: typing.ClassVar[int] = 20
-    cv1: typing.ClassVar = 30
-    cv2: T_CV2
-    cv3: T_CV3
-    not_cv4: T_CV4  # When using string annotations, this field is not recognized as a ClassVar.
+    T_CV4 = "typing.ClassVar"
+    cv0: "typing.ClassVar[int]" = 20
+    cv1: "typing.ClassVar" = 30
+    cv2: "T_CV2"
+    cv3: "T_CV3"
+    not_cv4: "T_CV4"  # When using string annotations, this field is not recognized as a ClassVar.
 
 @dataclasses.dataclass
 class IV:
-    T_IV4 = dataclasses.InitVar
-    iv0: dataclasses.InitVar[int]
-    iv1: dataclasses.InitVar
-    iv2: T_IV2
-    iv3: T_IV3
-    not_iv4: T_IV4  # When using string annotations, this field is not recognized as an InitVar.
+    T_IV4 = "dataclasses.InitVar"
+    iv0: "dataclasses.InitVar[int]"
+    iv1: "dataclasses.InitVar"
+    iv2: "T_IV2"
+    iv3: "T_IV3"
+    not_iv4: "T_IV4"  # When using string annotations, this field is not recognized as an InitVar.
diff -u ../python/cpython/Lib/test/dataclass_module_2.py test
diff -u ../python/cpython/Lib/test/dataclass_module_2_str.py test
--- ../python/cpython/Lib/test/dataclass_module_2_str.py	2018-05-16 06:50:50.000000000 -0400
+++ test/dataclass_module_2_str.py	2018-05-16 16:23:58.000000000 -0400
@@ -1,4 +1,4 @@
-from __future__ import annotations
+#from __future__ import annotations
 USING_STRINGS = True
 
 # dataclass_module_2.py and dataclass_module_2_str.py are identical
@@ -15,18 +15,18 @@
 
 @dataclass
 class CV:
-    T_CV4 = ClassVar
-    cv0: ClassVar[int] = 20
-    cv1: ClassVar = 30
-    cv2: T_CV2
-    cv3: T_CV3
-    not_cv4: T_CV4  # When using string annotations, this field is not recognized as a ClassVar.
+    T_CV4 = "ClassVar"
+    cv0: "ClassVar[int]" = 20
+    cv1: "ClassVar" = 30
+    cv2: "T_CV2"
+    cv3: "T_CV3"
+    not_cv4: "T_CV4"  # When using string annotations, this field is not recognized as a ClassVar.
 
 @dataclass
 class IV:
-    T_IV4 = InitVar
-    iv0: InitVar[int]
-    iv1: InitVar
-    iv2: T_IV2
-    iv3: T_IV3
-    not_iv4: T_IV4  # When using string annotations, this field is not recognized as an InitVar.
+    T_IV4 = "InitVar"
+    iv0: "InitVar[int]"
+    iv1: "InitVar"
+    iv2: "T_IV2"
+    iv3: "T_IV3"
+    not_iv4: "T_IV4"  # When using string annotations, this field is not recognized as an InitVar.
