File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 8
8
"""Pytest fixtures.
9
9
10
10
"""
11
+ import math
11
12
import os
12
13
import pathlib
13
14
from traceback import format_exc
@@ -73,10 +74,16 @@ def validate_parser_is_up_to_date():
73
74
last_source_modif = max (
74
75
os .path .getmtime (base_enaml_parser .__file__ ),
75
76
os .path .getmtime (base_python_parser .__file__ ),
76
- os .path .getmtime (pathlib .Path (base_enaml_parser .__file__ ).parent / "enaml.gram" ),
77
+ os .path .getmtime (
78
+ pathlib .Path (base_enaml_parser .__file__ ).parent / "enaml.gram"
79
+ ),
77
80
)
78
81
79
- assert os .path .getmtime (enaml_parser .__file__ ) >= last_source_modif , (
82
+ # We round the times to avoid spurious failure because both files were
83
+ # written at slightly different times.
84
+ assert math .ceil (os .path .getmtime (enaml_parser .__file__ )) >= math .floor (
85
+ last_source_modif
86
+ ), (
80
87
"Generated parser appears outdated compared to its sources, "
81
88
"re-generate it using enaml/core/parser/generate_enaml_parser.enaml"
82
89
)
@@ -109,7 +116,6 @@ def qt_app():
109
116
110
117
@pytest .fixture
111
118
def enaml_qtbot (qt_app , qtbot ):
112
-
113
119
qtbot .enaml_app = qt_app
114
120
pixel_ratio = QtGui .QGuiApplication .primaryScreen ().devicePixelRatio ()
115
121
You can’t perform that action at this time.
0 commit comments