Skip to content

Commit

Permalink
Make tests for access time less strict
Browse files Browse the repository at this point in the history
- allows real fs tests to pass on file systems on XFS fs
- fixes #453
  • Loading branch information
mrbean-bremen committed Nov 22, 2018
1 parent 457e11f commit ad05dc7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ The release versions are PyPi releases.
and `io.open`

#### Fixes

* make tests for access time less strict to account for file systems that
do not change it immediately ([#453](../../issues/453))

## [Version 3.5.2](https://pypi.python.org/pypi/pyfakefs/3.5.2)

Expand Down
8 changes: 4 additions & 4 deletions pyfakefs/tests/fake_stat_time_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def check_open_read_close_non_w_mode(self):
self.assertEqual(read.st_ctime, closed.st_ctime)

self.assertEqual(before.st_atime, opened.st_atime)
self.assertLessExceptWindows(opened.st_atime, read.st_atime)
self.assertLessEqual(opened.st_atime, read.st_atime)
self.assertEqual(read.st_atime, closed.st_atime)

self.assertEqual(before.st_mtime, opened.st_mtime)
Expand All @@ -301,7 +301,7 @@ def check_open_read_close_new_file(self):
self.assertEqual(created.st_ctime, read.st_ctime)
self.assertEqual(read.st_ctime, closed.st_ctime)

self.assertLessExceptWindows(created.st_atime, read.st_atime)
self.assertLessEqual(created.st_atime, read.st_atime)
self.assertEqual(read.st_atime, closed.st_atime)

self.assertEqual(created.st_mtime, read.st_mtime)
Expand Down Expand Up @@ -443,7 +443,7 @@ def test_open_read_close(self):
self.assertEqual(read.st_ctime, closed.st_ctime)

self.assertEqual(before.st_atime, opened.st_atime)
self.assertLessExceptWindows(opened.st_atime, read.st_atime)
self.assertLessEqual(opened.st_atime, read.st_atime)
self.assertEqual(read.st_atime, closed.st_atime)

self.assertLess(before.st_mtime, opened.st_mtime)
Expand Down Expand Up @@ -558,7 +558,7 @@ def test_open_read_flush_close(self):
self.assertEqual(flushed.st_ctime, closed.st_ctime)

self.assertEqual(before.st_atime, opened.st_atime)
self.assertLessExceptWindows(opened.st_atime, read.st_atime)
self.assertLessEqual(opened.st_atime, read.st_atime)
self.assertEqual(read.st_atime, flushed.st_atime)
self.assertEqual(flushed.st_atime, closed.st_atime)

Expand Down

0 comments on commit ad05dc7

Please sign in to comment.