Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TestTouch.test_set_custom_nstimes fails #53

Open
mgorny opened this issue May 7, 2020 · 0 comments
Open

TestTouch.test_set_custom_nstimes fails #53

mgorny opened this issue May 7, 2020 · 0 comments

Comments

@mgorny
Copy link
Contributor

mgorny commented May 7, 2020

I'm going to guess that the underlying file system has second precision.

________________________________________________________ TestTouch.test_set_custom_nstimes ________________________________________________________
                                                                                                                        
self = <test_fileutils.TestTouch object at 0x7ffa2bb51da0>                                            
                                                                         
    def test_set_custom_nstimes(self):          
        fileutils.touch(self.path)                   
        orig_stat = os.stat(self.path)  
        ns = (1, 1)             
        fileutils.touch(self.path, ns=ns)
        new_stat = os.stat(self.path)
                                                                                                
        # system doesn't have nanosecond precision, try microseconds                           
        if new_stat.st_atime == 0:                                                                  
            ns = (1000, 1000)                                                                              
            fileutils.touch(self.path, ns=ns)                                         
            new_stat = os.stat(self.path)                             

        assert orig_stat != new_stat                     
>       assert ns[0] == new_stat.st_atime_ns
E       assert 1000 == 0                                        
E         -1000
E         +0                                      

../../snakeoil-0.8.8/tests/module/test_fileutils.py:60: AssertionError

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant