Jonathan Eunice avatar Jonathan Eunice committed 9db43d9

tweaked tests

Comments (0)

Files changed (2)

 
 setup(
     name='options',
-    version=verno("0.200"),
+    version=verno("0.202"),
     author='Jonathan Eunice',
     author_email='jonathan.eunice@gmail.com',
     description='Container for flexible class, instance, and function call options',
     assert t.options.slick == 'S'
     t.push1(nick=44, slick=55)
     
-def test_files_ok():
+def test_files():
     # The underlying stuf container used to have (<0.9.9) a problem with files
     # being assigned in a stuf() constructor. This tests that we're over that
     # problem.
     
     # Get names of files that won't be munged by py.test's capturing mechanism
     # (sys.stdout and sys.stderr definitely will be overtaken by py.test, but
-    # their primitive double-underscore names won't be)
+    # their primitive double-underscore names won't be). This doesn't seem to
+    # be an issue with Python 2.x, but spuriously screws up the test otherwise
+    # in Python 3.x (gives false negative, saying module not working when it is)
+    
     f1 = sys.__stdout__
     f2 = sys.__stderr__
     f3 = sys.__stdin__
     assert ooo.a is f1
     assert ooo.b is f3
     assert ooo.c == 12
- 
-def test_files_push():
-    
-    class T3(object):
-        options = Options(
-            slick='slack',
-            nick='nack',
-            files = None
-        )
-        assert options.slick == 'slack'
-        assert options.nick  == 'nack'
-        assert options.files == None
-        flist = [ sys.stdout ]
-        assert flist[0] is sys.stdout
-        options.files = flist
-        assert options.files is flist
-        assert options.files[0] is sys.stdout
-        # options.files.append(sys.stdout)
-        
-        def __init__(self, *args, **kwargs):
-            self.options = T3.options.push(kwargs)
-            self.data = args
-            
-        def set(self, **kwargs):
-            """
-            Uplevel the set operation. A set() on this object is converted into
-            a set on its options.
-            """
-            self.options.set(**kwargs)
-        
-        def write(self, **kwargs):
-            opts = self.options.push(kwargs)
-            for f in opts.files:
-                six.print_(opts.nick, file=opts.f)
-            
-        def push1(self, **kwargs):
-            opts = self.options.push(kwargs)
-            
-            # persistent data test
-            assert T3.options.nick == 'nack'
-            assert T3.options.slick == 'slack'
-            assert t.options.nick == 'N'
-            assert t.options.slick == 'S'
-
-            # transient data test
-            assert opts.nick == 44
-            assert opts.slick == 55
-            
-            assert opts.files[0] is sys.stdout
-    
-    t = T3(nick='N', slick='S')
-    assert T3.options.nick == 'nack'
-    assert T3.options.slick == 'slack'
-    assert t.options.nick == 'N'
-    assert t.options.slick == 'S'
-    t.push1(nick=44, slick=55)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.