[Python-checkins] CVS: python/dist/src/Lib/test test___future__.py,1.2,1.3

Tim Peters tim_one@users.sourceforge.net
Fri, 17 Aug 2001 12:49:04 -0700


Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv11086/test

Modified Files:
	test___future__.py 
Log Message:
A self-contained piece of Michael Hudson's patch
    #449043 supporting __future__ in simulated shells
in support of PEP 264.

Much has changed from the patch version:
+ Repaired bad hex constant for nested_scopes.
+ Defined symbolic CO_xxx names so global search will find these uses.
+ Made the exported list of feature names explicit, instead of abusing
  __all__ for this purpose (and redefined __all__ accordingly).
+ Added gross .compiler_flag verification to test___future__.py, and
  reworked it a little to make use of the newly exported explicit list
  of feature names.


Index: test___future__.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test___future__.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** test___future__.py	2001/03/02 02:53:08	1.2
--- test___future__.py	2001/08/17 19:49:02	1.3
***************
*** 6,10 ****
  GOOD_SERIALS = ("alpha", "beta", "candidate", "final")
  
! features = [x for x in dir(__future__) if x[:1] != "_"]
  for feature in features:
      value = getattr(__future__, feature)
--- 6,10 ----
  GOOD_SERIALS = ("alpha", "beta", "candidate", "final")
  
! features = __future__.all_feature_names
  for feature in features:
      value = getattr(__future__, feature)
***************
*** 40,41 ****
--- 40,46 ----
          verify(optional < mandatory,
                 "optional not less than mandatory, and mandatory not None")
+ 
+     verify(hasattr(value, "compiler_flag"),
+            "feature is missing a .compiler_flag attr")
+     verify(type(getattr(value, "compiler_flag")) is IntType,
+            ".compiler_flag isn't int")